【问题标题】:Convert a "pygame" into .exe using py2exe使用 py2exe 将“pygame”转换为 .exe
【发布时间】:2016-01-01 23:43:59
【问题描述】:

我使用 pygame (python2.7) 创建了一个游戏,并尝试使用 py2exe 对其进行转换。

这些是我使用的模块: pygame,Tkinter,随机 这是我的“setup.py”:

from distutils.core import setup
import py2exe
setup(options={
            "py2exe":{
                "includes": ["Tkinter","pygame","random"]

            }
    }
)

当我尝试运行 .exe 文件时出现此错误:

NotImplementedError: font module not avaible
(ImportError: DLL load failed: module couldn't be found 

我需要改变什么?

【问题讨论】:

  • 游戏运行正常,但未转换

标签: python-2.7 pygame


【解决方案1】:

这里有两件事要检查。首先,确保您使用的是 32 位 python 和 32 位 pygame。 Pygame 只与 32 位 python 配合得很好,如果你忽略这一点,你就会打开一罐蠕虫。要检查的另一件事是确保所有模块的拼写方式与您在加载 dll 时在系统上的拼写方式相同。 (一个常见的怀疑是 Tkinter 有一个大写的模块名称,这可能会引发一些问题)

【讨论】:

  • 全部 32 位?我的意思是帽子之类的。检查您的 dll 是否确实存在于文件夹中,并发布更多代码 :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-07
  • 1970-01-01
  • 2014-01-21
  • 1970-01-01
相关资源
最近更新 更多