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