cx_Freeze .exe问题:Pygame错误:无法打开“文件名”

时间:2018-09-21 04:02:10

标签: python pygame jpeg mp3 cx-freeze

经过大量搜索后,我无法通过cx_Freeze解决此问题。这些问题并未提供有效的解决方案:

cx_Freeze Exe Application closes as soon as opens

How can I bundle other files when using cx_freeze?

文件与游戏其余部分位于同一目录中,当我从代码中运行游戏时,一切正常,唯一的问题是当我尝试从.exe文件中运行该文件时。

当我注释掉加载到音乐/图像中的游戏代码并以此为基础进行构建时,游戏运行正常。

!

1 个答案:

答案 0 :(得分:0)

包含文件的build_exe选项名为include_files,而不是included_files。尝试将设置脚本的相应行替换为

options={'build.exe': {'excludes': [excludes], "packages": ["pygame"],
                       'include_files': [includedfiles]}},
相关问题