无法在aws linux服务器上安装matplotlib

无法在aws linux服务器上安装matplotlib,matplotlib,Matplotlib,我尝试使用下面的命令在linux服务器上安装matplotlib,但失败了。。解决此问题的指南 python -mpip install matplotlib RuntimeError: sh ./configure failed. 命令“/usr/bin/python-u-c”导入setuptools, 标记化文件='/tmp/pip-install-Ex80fQ/subprocess32/setup.py';f=getattr(标记化,'open',open)(文件);code=f.

我尝试使用下面的命令在linux服务器上安装matplotlib,但失败了。。解决此问题的指南

python -mpip install matplotlib
RuntimeError: sh ./configure failed.



命令“/usr/bin/python-u-c”导入setuptools, 标记化文件='/tmp/pip-install-Ex80fQ/subprocess32/setup.py';f=getattr(标记化,'open',open)(文件);code=f.read().replace('\r\n', “\n”);f、 close();exec(编译(代码,文件,,'exec'))“安装 --record/tmp/pip-record-lOrC6I/install-record.txt--外部管理的单一版本--编译“失败,错误代码为1,位于/tmp/pip-install-Ex80fQ/subprocess32中/

尝试使用sudo apt get:

sudo apt-get build-dep python-matplotlib

这可能是因为您使用的AWS linux映像没有安装C编译器

要安装,它取决于您的发行版,但对我来说:
sudo-yum-groupinstall“开发工具”

之后,我还必须为python开发人员安装头文件:

sudo apt-get build-dep python-matplotlib