hey guys i need help with converting my code into an .exe (not for malisious reasons ofc), my code is consistant of 2 folders with 2 .py files, one being the main title that will activate the game and the other the game, it also uses png's and mp3's. i tried looking it up and tried using pyinstaller, py2exe, auto-py-to-exe. but nothing works, i also tried reinstalling python and updating it. if you can help me it would be great but i dont mind if this would be too much yapping of me and too complicated. -eeuwa
#π converting pygame(.py) to executable(.exe)
14 messages Β· Page 1 of 1 (latest)
@hollow patrol
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
pls tag me if you have a (posible) solution
You should be aware that python isn't really designed for this use case which is why the modules you mentioned above are fragile and frequently require tweaks to even get to potentially work in many cases
The only (practical) way to do this is using a library like pyinstaller. Could you elaborate on what "nothing works" means?
Do you get an error? Does it not run?
i never got it to open porperly, i had to doubleclick the run file cuz if i type python in the cmd in the correct location it shows an error, it does tell em its installed but it doesnt run the pyinstaller.
You didn't get pyinstaller to open?
yes
when i type pyinstaller (file) or python pyinstaller (file), i also tried other commands but i forgor
pyinstaller -F main.py
```is the default command for 1 file
there are also ways to import assets allong your exe by using the dir option
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.