这是一个创建于 4221 天前的主题,其中的信息可能已经有所发展或是发生改变。
代码如下:
#!/usr/bin/python
#filename : psctk.py
from Tkinter import *
root = Tk()
w = Label(root,text = "hello, world!")
w.pack()
root.mainloop()
运行的时候报错所TCL没有安装对:
Traceback (most recent call last):
File "psctk.py", line 6, in <module>
root = Tk()
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1745, in __
self.tk = _tkinter.create(screenName, baseName, classNam
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the follo
{C:\Python27\tcl\tcl8.5} C:/Python27/lib/tcl8.5 C:/lib/t
C:/library C:/library C:/tcl8.5.9/library C:/tcl8.5.9/librar
C:/Python27/tcl/tcl8.5/init.tcl: version conflict for packag
need exactly 8.5.2
version conflict for package "Tcl": have 8.5.9, need exactly
while executing
"package require -exact Tcl 8.5.2"
(file "C:/Python27/tcl/tcl8.5/init.tcl" line 20)
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.
不知道如何调试,请大侠不吝赐教。
1 条回复 • 1970-01-01 08:00:00 +08:00
|
|
1
ThunderEX 2013-04-23 16:38:25 +08:00
我之前遇到过在virtualenv里面跑tkinker,但tkinker的lib没有放到virtualenv里面,就会报这个错…… 把c:\python27\tcl直接拷进virtualenv就OK了。
|