【发布时间】:2015-11-16 05:31:24
【问题描述】:
我们目前正在为 Ludum Dare 开发 Cocos2D 游戏,但在将游戏打包成某种可执行文件时遇到了问题。
我们尝试过使用 py2exe,但它似乎不起作用。我读过 py2exe 经常会导致这类库出现问题,但它们通常是可行的。但是,过去几个小时我一直在做一些研究,但似乎找不到解决方案。
这是它在执行 .exe 时给我们的错误消息,显然它无法导入 pyglet.resource 模块。
C:\Users\Jon\Documents\GitHubVisualStudio\King-of-the-Dungeon\King of the Dungeon\King of the Dungeon\dist>king_of_the_dungeon.exe
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pyglet\__init__.py", line 351, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'path'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "king_of_the_dungeon.py", line 1, in <module>
File "C:\Python34\lib\site-packages\cocos2d-0.6.3-py3.4.egg\cocos\__init__.py", line 71, in <module>
pyglet.resource.path.append(
File "C:\Python34\lib\site-packages\pyglet\__init__.py", line 357, in __getattr__
__import__(import_name)
ImportError: No module named 'pyglet.resource'
【问题讨论】:
标签: python py2exe cocos2d-python