使用cx_Freeze时的属性错误

时间:2017-08-27 15:23:05

标签: python python-3.x cx-freeze python-3.6

在创建我的python游戏的exe时。我收到了以下错误Error

我在setup.py中的代码是

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
)

任何人都可以帮我解决这个问题。

1 个答案:

答案 0 :(得分:1)

您的设置脚本中可能需要version。像:

cx_Freeze.setup(
    name="Pongy",
    version='1.0',
    options={"build_exe": {"packages":["pygame","sys","random","time"],"include_files":["boing.wav","out.wav"]}},
    executables = executables
)

希望这能解决您的问题。