我正在尝试将 4 个 .py 文件和 2 个 .wav 文件扁平化为一个 exe。
我安装了 py2exe、python 1.6 和 pygame for python 1.6。这是我的设置文件。
from distutils.core import setup
import py2exe
import pygame
import snake
import food
import sys
sys.path.append("C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
setup(console=['snakegame.py'])
要编译,我输入“ python setup.py py2exe ”
当我尝试在 dist 文件夹中运行我的 exe 时,我受到了欢迎
C:\Users\Mattias\Desktop\Snake\dist>snakegame.exe
snakegame.exe:43: RuntimeWarning: use mixer: DLL load failed: The specified module could not be found.
(ImportError: DLL load failed: The specified module could not be found.)
Traceback (most recent call last):
File "snakegame.py", line 43, in <module>
File "pygame\__init__.pyc", line 70, in __getattr__
NotImplementedError: mixer module not available
(ImportError: DLL load failed: The specified module could not be found.)