How big is too big for a Pyinstaller exe file? How big is too big for a Pyinstaller exe file? tkinter tkinter

How big is too big for a Pyinstaller exe file?


The file size is normal. I don't think you can do much more with it.

Pyinstaller bundles python interpreter and supporting files along with it and the win32 dlls which will most probably take up atleast 12MB. You can check this by making a virtualenv with a hello world script and turn it into a exe.

As AKX says it doesn't burden the system much more than running python itself. The large file is not loaded into memory completely. It is unzipped into the %temp% folder with a folder name containing _MEIPASS and only required files are loaded into memory on the target machine. However, there is an overhead as startup to create a folder, unzip the files and delete them after exit.

Also don't compare it to C,C# etc because those languages don't need to bundle additional files like python because they would already be included in your system. Also I haven't used it myself but you may try py2exe. It is old but many apps use it and could reduce the file size a bit.


15 megabytes of disk and 30 megabytes of memory isn't really much in today's terms at all. (IMHO, whoever told you it would "burden the OS" is living somewhere in Windows 95 land, or earlier still.)

That file size is normal considering the Python interpreter, standard library, additional libraries and all are bundled in; a C# program being 64 kilobytes and doing the same is benefiting from the C# libraries and virtual machine having been shipped with Windows.

For contrast, in JavaScript land, where desktop apps tend to be Electron based, you start from around a hundred megabytes of disk use...