0

I compiled my pretty simple python script (windows 10) which normally when built shows the GUI which remains open (and working) until closed. However, the compiled executable version opens a command prompt window for a second and then it automatically closes instead of showing the GUI as the python script does.

Method used to compile:How can I convert a .py to .exe for Python?

Script

  • Try opening a `cmd` instance and running your `.exe` in there. Then, you should get a more detailed error message. Edit your post with that message. – Remolten Mar 27 '18 at 17:46

1 Answers1

0

Please don't use windows 10 with pyinstaller at this moment in time. You see, pyinstaller has issue with importing all necessary DLLs in Windows 10 because of the way Windows 10 uses them. Check this issue.

There is number of missing DLLs so you would need to install Win SDK (almost 2gb) or use virtual machine from Microsoft. I tried both options and in first option you need to get all necessary DLLs and keep them in the same folder as your .py file. In second method you don't need to do anything as pyinstaller is able to link Universal CRT without any issues.

Another important thing to remember when converting on windows: DON'T use UPX

pyinstaller my_app.py --onefile --windowed --noupx --clear

Above command works just fine on Windows 7 but would fail on Windows 10 with bunch of missing DLLs errors.

Another way to check why your app is failing is to convert it to exe without --windowed flag which would open a command line window along with your GUI. Then you would be able to see if there is any import errors.

Hope this helps.

Mick_
  • 131
  • 9