您的位置:首页 > 运维架构 > Linux

【编程语言】Python Tkinter模块安装 CentOS 7 下

2016-09-27 21:08 531 查看
本教程系统环境

系统: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


安装完成之后再次打开shell 交互端
输入命令

# 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
>>> 


无任何提示则说明安装成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: