天天看点

Python的Tkinter库的安装

Tkinter是Python的GUI widget。一般情况下Linux都没有自带,要自己安装。

1、确定Tkinter没有安装:

>>> import Tkinter

Traceback (most recent call last):

File "<stdin>", line 1, in ?

File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 41, in ?

    raise ImportError, str(msg) + ', please install the python-tk package'

ImportError: No module named _tkinter, please install the python-tk package

>>>

2、安装Tkinter:

$sudo apt-get install python-tk

3、安装成功:

>>> 

本文转自 pangfc 51CTO博客,原文链接:http://blog.51cto.com/983836259/1296127,如需转载请自行联系原作者