I'm trying to make my python program run on other systems without python installation. I made use of tkinter to create a gui, after creating an exe file with pyinstaller it throws a fatal error "Failed to run script". I've checked my code several times and it works well. I don't know what's wrong.
2 Answers
Create the file using the -F switch only and run from your command line. You should see the actual error.
build: pyinstaller -F your_script.py
run: C:\some_dir\dist\your_script.exe
I have run into issues like this when a module is in a directory that is lowercase and pyinstaller is looking for an uppercase first character. e.g. C:\Python27\Lib\site-packages\queue vs C:\Python27\Lib\site-packages\Queue
Comments
The error is very generic and at this point, it may not be possible to find the actual error what preventing the execution. In order to get actual error please exclude '--windowed' or '--noconsole' parameters during installation and then execute with 'pyinstaller -filename.py --onefile'. Then on execution it will show exact error instead of 'Fatal error! Failed to execute script'. Then you can proceed accordingly.