cx_freeze:在以下目录中找不到可用的init.tcl [英] cx_freeze: can't find a usable init.tcl in the following directories

查看:56
本文介绍了cx_freeze:在以下目录中找不到可用的init.tcl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知, cx_freeze 是唯一能够将Python脚本制作为 .exe 文件的应用程序.但是,我想在Python 3中制作一个GUI exe .在冻结了一个简单的Tkinter GUI并运行exe之后,出现以下错误:

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.

我正在使用简单设置 cx_freeze选项.

I am using the simple setup cx_freeze option.

我的cx_freeze exe捆绑包保存到以下目录:

My cx_freeze exe bundle is save to the following directory:

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

文件为:

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

推荐答案

我刚刚通过复制 tcl8.5 tk8.5 目录来解决了这个问题,位于Python 3安装目录中的应用程序所在的 .exe 文件夹中.

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.

这篇关于cx_freeze:在以下目录中找不到可用的init.tcl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆