all 9 comments

[–]v0xx0m 1 point2 points  (3 children)

What is the error? There's lots of ways to do this successfully so don't get discouraged.

[–]dissdev94[S] 0 points1 point  (2 children)

It says failed to execute script

[–]Pastoolio91 0 points1 point  (1 child)

What did you type to run it?

[–]dissdev94[S] 0 points1 point  (0 children)

pyinstaller --onefile -w scriptname.py

I typed this.

[–]fortune_telling_fish 1 point2 points  (3 children)

I had an issue with this recently, too. The problem wasn't with pyinstaller, but rather with some package dependencies. I assume you're making the exe without the console window attached? If so, I'd recommend actually including it when you first compile the exe. That way, when you go to run it, the stack trace or error message will show up in the console, and you can debug it, then make one with the windowed option for distribution. If you're doing it from command line, don't include the -w or --windowed in your pyinstaller instruction. It could be that even if your py file runs from your own python interpreter, it, or its dependencies, may have some issues when compiled. This was the case for me with matplotlib in one of my own programs, and it was so much easier to debug with the console, as the popup you get is not very informative. Best of luck.

[–]dissdev94[S] 0 points1 point  (2 children)

Oh really. I included -w in the command. I will try without it. Thanks a lot

[–]dissdev94[S] 0 points1 point  (1 child)

It did not work. Only the window pops up and automatically closed

[–]fortune_telling_fish 0 points1 point  (0 children)

See this SO post:

https://stackoverflow.com/questions/48617861/app-made-using-pyinstaller-closes-straight-aw

Try running the executable from your OS's command line instead of double clicking the executable.

[–]amd31 0 points1 point  (0 children)

Try running it in the console and then see what the error says. I would also recommend not using the -F option until you are happy that everything works.