Python IDLE 无法启动

发布于 2024-12-05 21:02:09 字数 908 浏览 0 评论 0原文

我是 python 菜鸟,大约一周前 IDLE 停止工作,我读过一些其他人对此的问题,但他们都没有遇到与我相同的错误,即:

Traceback (most recent call last):
    File "c:\python26\Lib\idlelib\idle.py", line 21, in <module>
        idlelib.Pyshell.main()
    File "C:\python26\Lib\idlelib\PyShll.py", line 1386, in main
        root = Tk(className="Idle")
    File "C:\python26\Lib\lib-tk\Tkinter.py", line 1643, in __init__
        self.tk = _tkinter.creat(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can´t find a usable init.tcl in the following directories:
        C:/Python26/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/library c:/library c:/
tcl8.5.2/library c:/tcl8.5.2/library
This probably means that Tcl wasn´t installed properly.

所以我重新安装了 python 大约 3 到4次了,我一直收到同样的错误。

对于任何为我提供解决此错误的方法的人,我将永远感激不尽。

顺便说一下,我在 Win 7 32 位上运行 Python 2.6.6。

谢谢。

I´m a noob in python and about a week ago IDLE stop working, I have readed some other people questions about this, but none of them had the same error that I´m getting, which is:

Traceback (most recent call last):
    File "c:\python26\Lib\idlelib\idle.py", line 21, in <module>
        idlelib.Pyshell.main()
    File "C:\python26\Lib\idlelib\PyShll.py", line 1386, in main
        root = Tk(className="Idle")
    File "C:\python26\Lib\lib-tk\Tkinter.py", line 1643, in __init__
        self.tk = _tkinter.creat(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can´t find a usable init.tcl in the following directories:
        C:/Python26/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/library c:/library c:/
tcl8.5.2/library c:/tcl8.5.2/library
This probably means that Tcl wasn´t installed properly.

So I have reinstall python about 3 to 4 times and I keep getting the same error.

I´ll will for ever be in debt to anyone that gives me a solution to this error.

By the way, I´m running Python 2.6.6 on Win 7 32-Bit.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

樱桃奶球 2024-12-12 21:02:09

此 TCL 问题已出现在许多 Python 论坛中,通常会阻止 IDLE GUI 启动,例如 http://www.gossamer-threads.com/lists/python/python/902912 与 TCL_LIBRARY 环境变量有关。尝试编辑环境变量

右键单击(我的)计算机,转到属性,高级选项卡,按环境变量并编辑 TCL_LIBRARY 以指示 Python 路径,例如 C:\Python26\tcl\tcl8.5 (或输入代表的路径 我注意到,当您安装其他可能依赖于 TCL 库的程序时,我会

遇到这个问题,因此更改变量可能会导致另一个已安装的应用程序出现问题。
希望这有帮助。

This TCL issue has appeared in a number of Python forums and is generally prevents the IDLE GUI from starting e.g. http://www.gossamer-threads.com/lists/python/python/902912 and is related to the TCL_LIBRARY enviroment variables. Try and edit the enviroment variables

Right click on (My) Computer, go to properties, Advanced Tab, press Environment Variables and edit TCL_LIBRARY to indicate the Python path e.g C:\Python26\tcl\tcl8.5 (or enter the path that represents your version. Idle should start then.

I noticed that this is an issue when you install other programs that may depend on the TCL Library. Happened to me after I installed SciLab. Therefore changing the variable may cause issues with another installed app.
Hope this helps.

缱倦旧时光 2024-12-12 21:02:09

某些文件夹可能已被删除或移除。

转到卸载程序,

选择Python,

单击“更改”,

然后单击“修复”,

允许计算机修复....此后应该可以工作。

一些注意事项*

始终确保所有内容都位于您在 CMD 中工作的同一目录中。我从 cmd 打开目录并将文件放在同一目录中。

还要检查“应用程序数据”文件夹中是否有任何 Python 文件。

请注意,“应用程序数据”文件夹可能被隐藏。

此外,当您重新安装时,单击“自定义”,Python 将允许您创建自己的自定义路径位置,这比 Python 选择的路径位置更有帮助且简单得多。

Some folders may have been deleted or removed.

Go to Uninstall Program

Choose Python

Click "Change"

Then click "repair"

Allow the computer to repair....Should work after this.

Some notes*

Always make sure everything is in the same directory that you are working in CMD. I opened up my directory from the cmd and put my files in the same directory.

Check your 'App data' folder too for any Python files.

Be aware that 'App data' folder may be hidden.

Also when you reinstall click customize and python will allow you to make your own customize path location which is helpful and a lot more simple then what python chooses.

谎言 2024-12-12 21:02:09

这可能是由于使用了错误版本的 Python 造成的。
32 位和 64 位的工作方式不同。

This could be caused by using the wrong version of Python.
32-bit and 64-bit work differently.

他不在意 2024-12-12 21:02:09

(假设您的 Python 安装没有损坏。您对 Python 安装进行了任何更改吗,请尝试安装其他任何内容?)

您的 Python 安装目录是什么?
Python_install_directory/tcl 下查看,init.tcl 应该在那里,是吗?
告诉我们你发现了什么。

(Assuming your Python install is not corrupt. Did you make any changes to the Python install, try and install anything else?)

What is your Python install directory?
Look under Python_install_directory/tcl , init.tcl should be there, is it?
Tell us what you find.

べ映画 2024-12-12 21:02:09

嘿,我不知道为什么这对我有用,但我只是右键单击空闲图标,然后单击“复制”。奇怪的是,这创建了另一个图标“IDLE重复”,当我尝试打开这个版本时它起作用了。希望这有帮助!

Hey idk why this worked for me but I just right clicked on the the idle icon and clicked "Duplicate". This created another icon "IDLE duplicate", weirdly, and when I try to open this version it works. Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文