2013-08-23 114 views
0

我正在努力將4個.py文件和2個.wav文件壓縮到一個exe文件中。py2exe + pygame「dll加載失敗」

我有py2exe,python 1.6和pygame for python 1.6 installed。這是我的設置文件。

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']) 

編譯I型 「蟒蛇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.) 
+0

可能重複的[Pygame.mixer模塊丟失?](http://stackoverflow.com/questions/10761581/pygame-mixer-module-missing) – sloth

+0

也許不相關,但是你必須使用那個老的python版? – ninMonkey

+0

雖然安裝Py2Exe我不得不使用2.6 – Zooty

回答

0

招呼你真的應該從python 1.6升級到2.7.3,這應該可以解決問題。