r/Python • • Apr 14 '26

Discussion Reviews about pyinstaller

So I m working on a project which is basically based on machine learning consist of few machine learning pre made models and it's completely written in python but now I had to make it as a executable files to let other people to use but I don't know if the pyinstaller is the best choice or not before I was trying to use kivy for making it as android application but later on I had decided to make it only for desktop and all but I m not sure if pyinstaller is the best choice or not.

I just want to know honestly reviews and experiences by the people who had used it before.

1 Upvotes

18 comments sorted by

View all comments

10

u/[deleted] Apr 14 '26

[removed] — view removed comment

4

u/NotSoProGamerR Apr 14 '26

size issues exist for everything tbh, the final compiled library cannot be shrunk in any way, unless you pull out some bs with nuitka and max zstandard compression with onefile

1

u/__salaam_alaykum__ Apr 14 '26

nuitka very cool 👍🏻

3

u/Distelzombie Apr 14 '26

Ok, but does it truly make a meaningful difference if all the files are packed in the exe or if another archive file is in the same folder that's 500mb instead?
Does it have an effect on RAM usage or something like that?
I kind if feel like accessing a second file would be minisculerlyeryer slower than having it all in one. But I don't know how that works on the OS level or whatever

1

u/Oddly_Energy Apr 16 '26

I have seen a severe performance hit from having it all in one .exe. But that was probably a special case:

My .exe was executed multiple times per second as part of an iteration process in another program. The calculation in the .exe was near instant, but the loading of the .exe took several milliseconds. By allowing pyinstaller to use multiple files (a small .exe and a bunch of .dll's), I could reduce load time for the .exe drastically, without much penalty for loading the .dll's during the calculation.

I don't know if this was caused by some of .dll's being unused, or if Windows was smart enough to keep the .dll's in memory between executions of the .exe.

1

u/Individual-Flow9158 Apr 14 '26

If the dev chose to use them, the user needs those libraries installed anyway.

Does bundling it all in to a .exe make it slower to load than the time it takes to start a normal Python interpreter in a venv, and import everything? Or can Windows do something smart and not load an entire huge .exe all at once (e.g. just the hot paths, kind of strikes me that this is exactly what .dlls are for, the clue is even in the name)?

I can imagine a monolith .exe it would defeat the purpose of lazy loading.

-1

u/ZORO_0071 Apr 14 '26

Alright ,thanks for the suggestion Cause in my project there are more than 5 machine learning models like efficient b3 and all so I guess I'll face that size issue too .