1

I'm trying to turn a game I made into an executable using Pyinstaller (I'd be open to other similar programs, but I can't get py2exe to work at all).

This is Windows 8, Python 2.7 + Pygame.

I created a simple hello.py file which just prints "hello world" and then turned that into an exe which worked perfectly. However, when I tried making the game itself into an exe, it's failing in strange ways.

The command I used was pyinstaller gamename.py in command line.

The process then ran to completion and created the exe,but when I try to open it I just get "gamename.exe" has stopped working. I tried openning it from the command prompt to see what errors it was printing, but that doesn't show any errors either.

Any ideas?

Thanks!

tymtam
  • 31,798
  • 8
  • 86
  • 126
antonin_scalia
  • 1,073
  • 2
  • 10
  • 11
  • 1
    hmm.. if you're open to other programs i know of a few but dunno about compatibility with win 8: there http://cx-freeze.sourceforge.net/, https://pypi.python.org/pypi/bbfreeze/1.1.3, http://pygtk.org/, https://sourceforge.net/projects/wxpython/files/wxPython/3.0.2.0/ - thats all i can think of just now – Rachel Gallen Jul 27 '16 at 21:53
  • I'll give all of these a shot, hopefully one of them works out. Which one are you most experienced with/would recommend? – antonin_scalia Jul 27 '16 at 23:32
  • I just tried cxfreeze and installed it, but none of the cx-freeze scripts seem to run in command line. It says that it isn't recognized as a command? – antonin_scalia Jul 27 '16 at 23:45
  • 1
    hey, sorry i fell asleep (i live in ireland - its 5am now - have you got Visual Studio? you can get it free https://www.visualstudio.com/downloads/download-visual-studio-vs. I found this blog v helpful when i was installing 3.23 http://www.taywils.me/2012/12/23/pythonfinance1.html Any reason you're still on 2.7? it's so old!!! – Rachel Gallen Jul 28 '16 at 04:01
  • 1
    Visual Studio makes it quite easy to install packages, especially in zip format, i tried WinPython but it's finicky.. – Rachel Gallen Jul 28 '16 at 04:03
  • 1
    bbfreeze comes highly recommended, it and wxPython.. surprised you're having trouble with cFreeze though, it's usually really good.. – Rachel Gallen Jul 28 '16 at 04:05
  • I managed to get cxfreeze working, still checking if it works on other people's computers, but it looks good. – antonin_scalia Jul 28 '16 at 15:14
  • Cool! That's great. I'm on a train at the mo to the middle of nowhere.. Ta for the vote!! :) – Rachel Gallen Jul 28 '16 at 15:15
  • Hey, I know this is an extremely old question, but I think I may have found the solution to your problem. Is there ever a time in your script that you display text on the pygame screen? – Qwerty Jan 15 '18 at 05:15

0 Answers0