centos 安装matplotlib出现的问题
2017-10-16 本文已影响0人
第八共同体
1.pip install matplotlib
纯洁环境跑该命令的时候是非常慢的,保不及会包超时错误,
所以pip换了一个国内的源
mkdir ~/.pip
touch pip.conf
修改pip.conf内容:
[global]
trusted-host = pypi.douban.com
index-url = http://pypi.douban.com/simple
再次跑pip install matplotlib
第二个报错
2.fatal error: Python.h: No such file or directory...error: command 'gcc' failed with exit status 1
具体信息如下:
_posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
安装相应的devel就行了
yum install python-devel
再次跑pip install matplotlib
即可。