I have a python code to search in pdf documents. When I run the .py file, it executes fine. However, i have made an executable file with pyinstaller. this exe file is taking too long to open - almost 10 minutes. What could be the reason?
Asked
Active
Viewed 888 times
1
-
1look it: https://stackoverflow.com/questions/9469932/app-created-with-pyinstaller-has-a-slow-startup – Luis Bote Mar 19 '21 at 07:56
-
Does this answer your question? [App created with PyInstaller has a slow startup](https://stackoverflow.com/questions/9469932/app-created-with-pyinstaller-has-a-slow-startup) – Luis Bote Mar 19 '21 at 07:58
-
How large is the EXE? How did you ever manage to wait 10 minutes for it to start? How did you measure that? I would suggest looking into it with [Process Monitor](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon) – Thomas Weller Mar 19 '21 at 07:58
-
Since you have not mentioned your application structure and the size of your executable the best I can suggest is to exclude all the unnecessary files and prune the unused imports while you package your app. – NIV Mar 19 '21 at 08:29
1 Answers
1
10 minutes is very very long. But it you build a single executable with pyinstaller, it will uncompress itself into a temp folder everytime it starts. That folder will contain the required libraries a modified version of the Python interpretor and your own code in pre-compiled form. If you use a slow disk unit or have little space on it, it will indeed take time.
A possible way to speed up the start time is to have pyinstaller build a folder. This will save the initial uncompressing time.

Serge Ballesta
- 143,923
- 11
- 122
- 252