Speeding up an .exe created with Pyinstaller

Try making a virtual environment and run your project from there. Then run pyinstaller from inside the virtual environment so you only package what you need. This will do most for you

Secondly onedir option is faster than onefile since it does not have to unpack all the files from your exe into a temp folder. Pyinstaller makes it easy to use qny other installer to move it to program files and make a shortcut in start or something.


have a look at the documentation, i guess that explains, why it is slow: https://pyinstaller.readthedocs.io/en/stable/operating-mode.html#how-the-one-file-program-works

Short answer, a complete environment for your program needs to be extracted and written to a temporary folder.

Furthermore the one-file option is in contrast to what you expected: https://pyinstaller.readthedocs.io/en/stable/operating-mode.html#bundling-to-one-file