【发布时间】:2017-07-08 15:37:27
【问题描述】:
我正在尝试使用 cx_Freeze 从我的 Python 项目创建一个可执行文件,但一直遇到此错误:
这是我的 setup.py:
import cx_Freeze
import os, sys
os.environ['TCL_LIBRARY'] = "D:\\Code\\Python\\3.5.2\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "D:\\Code\\Python\\3.5.2\\tcl\\tk8.6"
base = None
if sys.platform == "win32":
base = "Win32GUI"
executables = [cx_Freeze.Executable("Main.pyw", base=base)]
includes = ["tkinter"]
include_files = [r"D:\Code\Python\3.5.2\tcl\DLLs\tcl86t.dll", \
r"D:\Code\Python\3.5.2\tcl\DLLs\tk86t.dll"]
cx_Freeze.setup(
name="Test",
version = "1.0",
options={"Test.exe": {"packages":["pygame", "numpy"], "includes": includes, "include_files": include_files}},
executables = executables)
我尝试将tkinter 放在“包”列表中,但仍然出现同样的错误。我还检查了其他 StackOverflow 帖子并将他们的部分setup.py 代码用于我的,但没有任何效果。我不能使用PyInstaller,因为它不支持pygame,而py2exe 不支持Python 3.5。任何帮助将不胜感激。
【问题讨论】:
-
等到 cx_freeze 得到更新。目前放弃的项目