本教程系统环境
系统:CentOS 7
Python 版本:python 2.7.5
打开python shell 端,输入以下命令
import Tkinter
出现以下内容
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Tkinter
说明系统中没有安装Python Tkinter模块
安装Python Tkinter模块
输入以下命令
yum -y install tkinter
输入命令
# python
Python 2.7.5 (default, Sep 15 2016, 22:37:39)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
无任何提示则说明安装成功