First I am a newbee to Python having done several programs over the past
several weeks. I have created code that I had working very well before
I use pyinstaller to mak .exe files.
I have used the pyinstaller with the --onefile parameter and all .exe
files have worked very well up until yesterday.
I am running python 3.95 on a win10 20h2 system. I tried to use
pyinstaller yesterday and it seemed to work as it should but when I try
to run the .exe file the command prompt comes up as it should but then
closes within a couple of seconds thus not running the program as it
should. The only thing that has changed on my system is any recent
I have also created some exceptions in Windows Defender to prevent it
from flagging the new .exe files as a virus. I will also include that I
happen to be blind.
Anyone got a clue what is happening?
Try running the executable from cmd instead of double-clicking it in your file explorer. i.e. After running pyinstaller --onefile your-code.py run dist\your-code.exe. It should still fail but it will print a Python error message so you know what its problem is. Post the error message here if it’s not self explanatory.