【发布时间】:2019-01-06 11:16:26
【问题描述】:
基本上创建可执行文件后,pygame突然无法打开.png图像。
我使用的是 Python 3.5 和 cx_Freeze 版本 5.1.1。
图像与游戏文件位于同一目录中。游戏在使其成为可执行文件之前运行良好。任何帮助将不胜感激。
这是我的setup.py:
from cx_Freeze import setup, Executable
setup(name="Mygame",
version="1.0",
description="my game",
options={"build.exe":{"packages":["pygame"],
"included_files":["vivi.png","anastasia.png","Bird.png"]}},
executables=[Executable("george_abc.py")])
这是我得到的错误:
Traceback (most recent call last):
File "C:\Users\Μάνος\AppData\Local\Programs\Python\Python35\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
module.run()
File "C:\Users\Μάνος\AppData\Local\Programs\Python\Python35\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
exec(code, m.__dict__)
File "george_abc.py", line 164, in <module>
pygame.error: Couldn't open vivi.png
【问题讨论】:
标签: python image pygame cx-freeze