2017-08-27 106 views
1

同時創建我的python遊戲的exe文件。我得到了以下錯誤Error使用cx_Freeze時出現屬性錯誤

我在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

您的安裝腳本中可能需要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 
) 

希望這將解決您的問題。

相關問題