我尝试使用 py2exe 在 python 中从我的程序中制作一个 exe。我的程序包含多个声音和图像文件。问题是,当我尝试运行 exe 时,它给了我一个错误:
C:\Users\Eduard\Desktop\testordner>test.exe
test.exe:7: RuntimeWarning: use mixer: DLL load failed: Das
angegebene Modul wurde nicht gefunden.
(ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.)
Traceback (most recent call last):
File "test.py", line 7, in <module>
mixer.init()
File "pygame\__init__.pyc", line 70, in __getattr__
NotImplementedError: mixer module not available
(ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.)
在我的程序中,我还使用了模块 Tkinter、随机、来自 itertools 的循环和来自 pygame 的混合器。我在设置文件中都提到了它们,但我不知道是否有必要。这里也是安装文件:
from distutils.core import setup
import Tkinter as tk
from itertools import cycle
from pygame import mixer
import random
import py2exe
setup(console=[{"script":"test.py"}],options={"py2exe":{"packages":["pygame"]}})