0
我正尝试使用cx_freeze库从我的python脚本构建一个exe文件。这是我的代码:cx_freeze中的TCL_LIBRARY
import easygui
easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No'))
,这是我的设置代码:
import cx_Freeze
import sys
import matplotlib
base = None
if sys.platform == 'win32':
base = "Win32GUI"
executables = [cx_Freeze.Executable("tkinterVid28.py", base=base, icon="clienticon.ico")]
cx_Freeze.setup(
name = "SeaofBTC-Client",
options = {"build_exe": {"packages":["easygui","matplotlib"]}},
version = "0.01",
description = "Sea of BTC trading application",
executables = executables
)
,然后我得到这个错误:在编译时你必须
File "C:\Python36\lib\site-packages\cx_Freeze\finder.py", line 485, in _LoadPackage
self._LoadModule(name, fp, path, info, deferredImports, parent)
File "C:\Python36\lib\site-packages\cx_Freeze\finder.py", line 463, in _LoadModule
self._RunHook("load", module.name, module)
File "C:\Python36\lib\site-packages\cx_Freeze\finder.py", line 536, in _RunHook
method(self, *args)
File "C:\Python36\lib\site-packages\cx_Freeze\hooks.py", line 613, in load_tkinter
tclSourceDir = os.environ["TCL_LIBRARY"]
File "C:\Python36\lib\os.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'TCL_LIBRARY'
@J。 doe请看我更新的答案 – Simon