gpt4 book ai didi

python-2.7 - PyInstaller 在 Windows 7 : "Can' t find a usable init. tcl 上失败”

转载 作者:行者123 更新时间:2023-12-04 16:10:41 27 4
gpt4 key购买 nike

我有一个使用 Tkinter 的基本 Python 脚本。

from Tkinter import Tk
from tkFileDialog import askdirectory
Tk().withdraw()
print askdirectory()

使用 PyInstaller 编译我的脚本后,我尝试在没有安装 Python 的 Windows 7(64 位)计算机上运行我的程序。

它引发了这个错误:
Can't find a usable init.tcl in the following directories: [list of directories]
This probably means that Tcl wasn't installed properly

为什么我的脚本找不到 init.tcl用 PyInstaller 编译后?

最佳答案

这是 Windows 7 64 位机器上 PyInstaller 和 Tkinter 的一个已知问题。有一个issue report在 PyInstaller 的 GitHub 存储库中。

一直在底部这个问题是从另一个问题中引用的,即this one这表示降级到 PyInstaller 3.1.0 有助于其他人解决问题。

pip install pyinstaller==3.1.0

我自己已经能够使用虚拟机确认这一点。

关于python-2.7 - PyInstaller 在 Windows 7 : "Can' t find a usable init. tcl 上失败”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42180492/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com