compiling a python program that uses pygame into an executable

前端 未结 3 896
旧时难觅i
旧时难觅i 2021-01-13 07:33

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

相关标签:
3条回答
  • 2021-01-13 08:06

    You should use PyInstaller to turn your program and its dependencies into a standalone executable
    https://pypi.org/project/PyInstaller/
    Using it is as simple as running pyinstaller /path/to/yourscript.py

    0 讨论(0)
  • 2021-01-13 08:08

    Try running the .exe from the command line to see if it's printing some kind of error message. Probably it's missing some DLLs, which you'll need to manually specify when executing py2exe.

    This blog post might be useful.

    0 讨论(0)
  • 2021-01-13 08:11

    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__

    0 讨论(0)
提交回复
热议问题