使用cx_Freeze时发生属性错误 [英] Attribute Error while using cx_Freeze
本文介绍了使用cx_Freeze时发生属性错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在创建python游戏的exe时。我收到以下错误
while creating exe of my python game . I got the following error
我在setup.py中的代码是
my code in setup.py is
import cx_Freeze
import os
os.environ['TCL_LIBRARY'] = "C:\\Users\Vinayak Singla\\Appdata\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\Vinayak Singla\\Appdata\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6"
executables = [cx_Freeze.Executable("pong.py")]
cx_Freeze.setup(
name="Pongy",
options={"build_exe": {"packages":["pygame","sys","random","time"],"include_files":["boing.wav","out.wav"]}},
executables = executables
)
任何人都可以帮我解决这个问题。 / p>
Can anyone help me to solve this.
推荐答案
您的安装脚本中可能需要版本
。像这样:
You might need a version
in your setup script. Like:
cx_Freeze.setup(
name="Pongy",
version='1.0',
options={"build_exe": {"packages":["pygame","sys","random","time"],"include_files":["boing.wav","out.wav"]}},
executables = executables
)
希望这会解决您的问题问题。
Hope this will solve your problem.
这篇关于使用cx_Freeze时发生属性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文