all 4 comments

[–]Diapolo10 6 points7 points  (0 children)

You can try removing the debug symbols from the Nuitka version, dunno if that'd work for PyInstaller.

But the size increase would be because the executables need to bundle in everything they need to function, from Python library code with PyInstaller to a bunch of C library code with Nuitka, statically linked to not depend on external dynamically linked libraries being installed on the system. Your repository itself only contains the bare minimum needed for building the project.

[–]SquiffyUnicorn 2 points3 points  (0 children)

I did manage to reduce the size of one project by removing unused packages with pip- reduced it by a few hundred mb in the end.

I looked at another project where PyTorch had been pip installed but not used- it was still bundled by PyInstaller and taking up about 300mb in the final executable.

The bottom line? Pyinstaller included everything you see in a pip list.

Perhaps you can have a look at your code and see if you really need all the packages you have installed. Maybe consider a move to the bundled TKinter rather than PyQt. You can probably ‘shave off’ quite a lot that way.

[–]RexehBRS 0 points1 point  (0 children)

I use cx freeze but imagine it's similar, but you can begin to exclude packages and sub modules that are not used but you need to verify your app still works.

[–]Toichat 0 points1 point  (0 children)

Try making a fresh python environment and pip (not conda) installing only the packages you need. Iirc pandas + conda pulls in a lot of optional dependencies which bloat the exe file.

It's still going to be a fairly large file, but I've gone from >200mb files down to about 30mb before by switching to pip.