开发者

Python IDLE won´t start

开发者 https://www.devze.com 2023-04-07 03:19 出处:网络
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:

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.cre开发者_开发问答at(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.


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.


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.


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


(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.


Hey I don't know 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消