pip3 install matplotlib安装完该绘图库后,进入Python交互式命令行中执行导入操作,返回错误如下

Matplotlib模块依赖于tkinter模块绘图,于是执行导入tkinter模块
>>> import tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'tkinter'pip3来安装,然而居然不存在。
# pip3 list | grep tkinter # pip3 install tkinter Looking in indexes: https://pypi.doubanio.com/simple/ Collecting tkinter Could not find a version that satisfies the requirement tkinter (from versions: ) No matching distribution found for tkinterTkinter是Python下调用tcl程序的标准程序包,于是通过以下方式尝试安装
# yum -y install python34-tkinter tk-devel