I am using cx_freeze to transfer a python file to a exe. the problem is when i exclude tkinter in the setup.py, i can generate the exe file successfully, but when execute the exe file, it says No Module named tkinter
.
build_exe_options = {"packages": ["os","numpy","time","optparse","linecache","pandas",
"matplotlib","PIL"], "excludes": ["tkinter"]}
but when I try to include tkinter
, it just can't generate the exe file.
build_exe_options = {"packages": ["os","numpy","time","optparse","linecache","pandas",
"matplotlib","PIL","tkinter"]}
File "C:Userschangchun_xuAppDataLocalProgramsPythonPython36-32libos.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'TCL_LIBRARY'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…