求助 Tkinter 出错
初学Python,调用脚本idle3时出错了,我装的是Python3.2,之前机器里面原带的是Python2.6。
在终端里输入没有问题
$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
用命令idle3出错/usr/local/lib/python3.2/idlelib$ idle3
** IDLE can't import Tkinter. Your Python may not be configured for Tk. **
看了PyShell.py里面写的是
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter. " \
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
sys.exit(1)
我把它改成from Tkinter import * 依然报** IDLE can't import Tkinter. Your Python may not be configured for Tk. **
求助如何解决!!!
[解决办法]
没注意看你不是用的windows,ubuntu 10.04是吧?
sudo apt-get install python3-tk