cx_freeze: can't find a usable init.tcl in the following directories

久未见 提交于 2021-02-07 05:48:05

问题


As far as I'm aware, cx_freeze is the only app able to make Python scripts to .exe files. However, I would like to make a GUI exe in Python 3. And after freezing a simple Tkinter GUI and running the exe, I get the following error:

> _tkinter.TclError: Can't find a usable init.tcl in the following directories:
>     {C:\Users\User\Desktop\tkinter\build\exe.win32-3.1\tcl}
> C:/Users/User/Desktop/tkinter/build/exe.win32-3.1/tcl8.5
> C:/Users/User/Desktop/tkinter/build/lib/tcl8.5
> C:/Users/User/Desktop/tkinter/build/lib/tcl8.5
> C:/Users/User/Desktop/tkinter/lib/tcl8.5
> C:/Users/User/Desktop/tkinter/build/library
> C:/Users/User/Desktop/tk inter/library
> C:/Users/User/Desktop/tkinter/tcl8.5.2/library
> C:/Users/User/Desktop/tcl8.5.2/library

> This probably means that Tcl wasn't installed properly.

I am using the simple setup cx_freeze option.

My cx_freeze exe bundle is save to the following directory:

C:\Users\User\Desktop\tkinter\build\exe.win32-3.1

Files are:

_ctypes.pyd
_tkinter.pyd
basicLABEL.exe
library.zip
python31.dll
tcl85.dll
tk85.dll
unicodedata.pyd

回答1:


I have just solved the problem myself by copying the tcl8.5 and tk8.5 directories, located in the Python 3 installation directory, into the .exe folder the app works.



来源:https://stackoverflow.com/questions/5523294/cx-freeze-cant-find-a-usable-init-tcl-in-the-following-directories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!