看来,应该是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 tkinter
测试是否安装成功并可用
# python3 Python 3.4.8 (default, Apr 9 2018, 11:43:18) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>> import matplotlib.pyplot as plt #没有消息就是最好的消息