PyInstaller 在 Windows 7 上失败:“找不到可用的 init.tcl" [英] PyInstaller fails on Windows 7: "Can't find a usable init.tcl"

查看:61
本文介绍了PyInstaller 在 Windows 7 上失败:“找不到可用的 init.tcl"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a basic Python script which uses Tkinter.

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

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

After compiling my script with PyInstaller, I tried to run my program on Windows 7 (64-bit) computer which didn't have Python installed.

它引发了这个错误:

Can't find a usable init.tcl in the following directories: [list of directories]
This probably means that Tcl wasn't installed properly

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

Why does my script fail to find init.tcl after compiling with PyInstaller?

推荐答案

这是 Windows 7 64 位机器上 PyInstaller 和 Tkinter 的一个已知问题.PyInstaller 的 GitHub 存储库中有一份问题报告.

This is a known issue with PyInstaller and Tkinter on Windows 7 64-bit machines. There is an issue report in the GitHub repository of PyInstaller.

一直以来这个问题都是从另一个问题引用的,即这个 表示降级到 PyInstaller 3.1.0 可以帮助其他人解决问题.

All the way at the bottom this issue was referenced from another issue, namely this one which says that downgrading to PyInstaller 3.1.0 helps other people solve the issue.

pip install pyinstaller==3.1.0

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

I myself have been able to confirm this using a Virtual Machine.

这篇关于PyInstaller 在 Windows 7 上失败:“找不到可用的 init.tcl"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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