Search code examples
pythonexecutablepygamepy2exe

compiling a python program that uses pygame into an executable


I wanted to compile my python program that uses pygame into an executable using py2exe but I'm experiencing some problems. I run the script in the windows command line and it seems to work. It creates a dist directory but when I try to open the .exe file, it briefly opens a command line window and then doesn't do anything.

Could this possibly be because I've used pygame and py2exe doesn't support it? Or do I need to put a copy of the pygame library into the same directory as my program?


Solution

  • There is an answer to this on the pygame wiki: http://pygame.org/wiki/Pygame2exe To include pygame in the executable, you will need to edit BuildExe.__init__