Python IDLE,Module Docs和Python(命令行)无法弹出

时间:2015-06-08 20:22:12

标签: python python-2.7

我刚刚安装了python 2.7.10。然后,当我尝试打开IDLE(Python GUI),Module Docs和Python(命令行)时。我只能看到“请等待Windows配置python 2.7.10”。 IDLE(Python GUI),模块文档和Python(命令行)永远不会弹出。

然后,我在C:\ Python27 \ Lib \ idlelib下打开一个命令窗口,输入“python idle.py”。我收到了以下错误:

C:\Python27\Lib\idlelib>python idle.py
Traceback (most recent call last):
  File "idle.py", line 11, in <module>
    idlelib.PyShell.main()
  File "C:\Python27\Lib\idlelib\PyShell.py", line 1541, in main
    root = Tk(className="Idle")
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 1814, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive,     want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
    {C:\Python27\tcl\tcl8.5} C:/Python27/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

C:/Python27/tcl/tcl8.5/init.tcl: version conflict for package "Tcl": have     8.5.2,
 need exactly 8.5.15
version conflict for package "Tcl": have 8.5.2, need exactly 8.5.15
    while executing
"package require -exact Tcl 8.5.15"
    (file "C:/Python27/tcl/tcl8.5/init.tcl" line 19)
    invoked from within
"source C:/Python27/tcl/tcl8.5/init.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $tclfile]"


This probably means that Tcl wasn't installed properly.

我应该怎么做才能弹出IDLE(Python GUI),Module Docs和Python(命令行)?

2 个答案:

答案 0 :(得分:0)

答案在你的错误中;最简单的方法可能就是重新安装它。

答案 1 :(得分:0)

所以Tcl是GUI的包。基本上它允许计算机创建弹出窗口。由于IDLE依赖于弹出窗口,缺少Tcl会导致崩溃。现在对于Windows(这是我假设您正在使用的),ActiveState有免费的ActiveTCL。这是该应用的链接。

此软件包的安装还有一个video。尝试安装它然后重新运行空闲。如果这不起作用,那么尝试重新安装python并运行'pip install tkinter'来安装python接口到Tcl。执行这些步骤后,运行再次空闲。