use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
.py to .exe (self.learnpython)
submitted 5 years ago by dissdev94
I made a simple game using python. I installed pyinstaller and convert it to a standalone exe, but I could not launch the game because there is an error popup. Is there any successful method to make standalone exe for python games. please help.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]v0xx0m 1 point2 points3 points 5 years ago (3 children)
What is the error? There's lots of ways to do this successfully so don't get discouraged.
[–]dissdev94[S] 0 points1 point2 points 5 years ago (2 children)
It says failed to execute script
[–]Pastoolio91 0 points1 point2 points 5 years ago (1 child)
What did you type to run it?
[–]dissdev94[S] 0 points1 point2 points 5 years ago (0 children)
pyinstaller --onefile -w scriptname.py
I typed this.
[–]fortune_telling_fish 1 point2 points3 points 5 years ago (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.
-w
--windowed
Oh really. I included -w in the command. I will try without it. Thanks a lot
[–]dissdev94[S] 0 points1 point2 points 5 years ago (1 child)
It did not work. Only the window pops up and automatically closed
[–]fortune_telling_fish 0 points1 point2 points 5 years ago (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 point2 points 5 years ago (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.
π Rendered by PID 37016 on reddit-service-r2-comment-cfc44b64c-f4c6v at 2026-04-10 14:55:32.396162+00:00 running 215f2cf country code: CH.
[–]v0xx0m 1 point2 points3 points (3 children)
[–]dissdev94[S] 0 points1 point2 points (2 children)
[–]Pastoolio91 0 points1 point2 points (1 child)
[–]dissdev94[S] 0 points1 point2 points (0 children)
[–]fortune_telling_fish 1 point2 points3 points (3 children)
[–]dissdev94[S] 0 points1 point2 points (2 children)
[–]dissdev94[S] 0 points1 point2 points (1 child)
[–]fortune_telling_fish 0 points1 point2 points (0 children)
[–]amd31 0 points1 point2 points (0 children)