LukeDev
LukeDev

Reputation: 541

Pyinstaller "Failed to execute script pyiboot01_bootstrap"

I'm using pyinstaller to produce an exectuable for a python program. But, whenever I try to use a generated executable, I get a message window that reads "Failed to execute script ...".

The command I'm running is pyinstaller -w run.py. But, when run with the --debug option a different error is made apparent. "Failed to execute script pyiboot-1_bootstrap". After this error it kills the program.

I tried with the -F option and that did not change the outcome. All the files I created for the project are in the same directory. I did get warnings that dll's weren't being included but I resolved that.

Upvotes: 3

Views: 11314

Answers (2)

LukeDev
LukeDev

Reputation: 541

Pyinstaller doesn't like the built in quit() function I was using.

Instead use sys.exit() to close the program.

See this question to see why sys.exit() is better practice for production code.

Upvotes: 7

eeshankhan
eeshankhan

Reputation: 51

What I found useful was to make an exe of my .py script in console mode and then run it. For a very short period of time, I saw an error message in the console window. I had to screenshot it to read completely. So one of the imports was missing from the folder in which I had my script. I opened cmd from the location bar of that folder (by typing cmd there) and imported modules using pip install <module_name>. Sorry for the long answer, I am a newbie.

Upvotes: 5

Related Questions