Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tiny python executable?

I plan to use PyInstaller to create a stand-alone python executable. PythonInstaller comes with built-in support for UPX and uses it to compress the executable but they are still really huge (about 2,7 mb).

Is there any way to create even smaller Python executables? For example using a shrinked python.dll or something similiar?

like image 249
user32756 Avatar asked Oct 31 '08 19:10

user32756


1 Answers

If you recompile pythonxy.dll, you can omit modules that you don't need. Going by size, stripping off the unicode database and the CJK codes creates the largest code reduction. This, of course, assumes that you don't need these. Remove the modules from the pythoncore project, and also remove them from PC/config.c

like image 77
Martin v. Löwis Avatar answered Oct 16 '22 16:10

Martin v. Löwis