I am using pyinstaller(v3.2.1) to build a --onefile windows exe. I am using multiprocessing within my python (v3.5.3) script. I have implemented the below mentioned workaround for windows.
Recipe Multiprocessing
Logically, my python script does not span multiple process unless required / conditions are met and is working as expected. The issue I have is that, whenever multiple processes are involved, everything seems fine. But in case, if multiprocess is not involed, the below "Fatal: Could not execute the script" dialog box flashes for couple of seconds or more and then disappears still returning the expected results.
Is there anything I am missing that is causing the fatal error dialog to appear and disappear ? I suspect the multiprocessing.freeze()
statement right after if __name__ == __main__ :
might be causing the issue when new processes are not created!
I had the same issue and followed Eugene Chabanov's advise of using pyinstaller without any special characters just pyinstaller yourapp.py
, when the exe was ready I opened it using the windows CMD and it got stuck in CMD with the error:
ModuleNotFoundError: No module named 'babel.numbers'
I then ran pyinstaller again this time pyinstaller -F --hidden-import "babel.numbers" test.py
and it works beautifully.
Try to see what error you get and if it is "ModuleNotFoundError" then just run pyinstaller adding --hidden-import "missing_module_name"
.
I hope it helps.
These people deserve the credit for helping me:
--hidden-import "missing_module_name" - M. R.
run without windowed - Eugene Chabanov
I've had similar issue and solved it by running compile command without -windowed
prefix and then launching exe file using command line.
It allowed to see where the error was. Script was referring to a file that wasn't there.
Error popped out on another computer, while everything was ok on mine. (because of hardcoded file in place)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With