linux下安装python的matplotlib、numpy等这些库有点麻烦,经常还报错。我自己试了可用的方法:
方法1:
# 安装numpu
sudo yum -y install gcc gcc-c++ numpy python-devel scipy
# 安装libpng-devel
sudo yum install libpng-devel
# 安装matplotlib
sudo yum install matplotlib
# 后来发现,其实装matplotlib的时候会自动安装numpu这些依赖
方法2:
yum search matplotlib
# 返回结果是:
[root@dn1 Desktop]# yum search matplotlib
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: [mirrors.btte.net](http://mirrors.btte.net)
* extras: [mirrors.btte.net](http://mirrors.btte.net)
* updates: mirrors.skyshe.cn
=========================== N/S matched: matplotlib ============================
python-matplotlib-doc.x86_64 : Documentation files for python-matplotlib
python-matplotlib-qt4.x86_64 : Qt4 backend for python-matplotlib
python-matplotlib-tk.x86_64 : Tk backend for python-matplotlib
python-matplotlib.x86_64 : Python 2D plotting library
# 选择最下方的那个,安装
yum install python-matplotlib.x86_64
最终方法:
使用anaconda,anaconda帮我们把所有这些库都集成了,可参考官方网站(https://www.anaconda.com/download/#linux)
网友评论