Ubuntu 16.04 虚拟环境安装matplotlib
参考文献:
https://blog.csdn.net/weiqing1995/article/details/79846837
https://blog.csdn.net/mr_sdhm/article/details/79119300
pip和apt-get安装区别:https://blog.csdn.net/rona_lin/article/details/45028277
首先采用:sudo apt-get install python-matplotlib ,看起来安装成功,但是测试出错
(我尝试卸载:pip uninstall matplotlib
WARNING: Skipping matplotlib as it is not installed.)
需要使用pip:而且按照上述博客,需要先
pip install scipy
然后再
pip install matplotlib
测试 import matplotlib.pyplot as plt 出错:
ImportError: No module named ‘_tkinter’, please install the python3-tk package
安装 python3-tk,采用:pip install python3-tk;出错:
ERROR: Could not find a version that satisfies the requirement python3-tk (from versions: none)
ERROR: No matching distribution found for python3-tk
然后:sudo apt-get install python3-tk 成功。