【问题标题】:py2exe + pygame "dll load failed"py2exe + pygame "dll 加载失败"
【发布时间】:2013-08-23 11:09:07
【问题描述】:

我正在尝试将 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.)

【问题讨论】:

  • 也许不相关,但你必须使用那个旧的 python 版本吗?
  • 在安装 Py2Exe 时我必须使用 2.6

标签: python pygame py2exe


【解决方案1】:

你真的应该从 python 1.6 升级到 2.7.3,这应该可以解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多