无法在AWS Linux服务器上安装matplotlib

时间:2018-07-10 11:54:26

标签: matplotlib

我尝试使用以下命令在Linux服务器上安装install matplotlib,但此操作失败。.指南来解决此问题。

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

Failed building wheel for subprocess32
  Running setup.py clean for subprocess32
Failed to build subprocess32
cloud-init 0.7.6 requires argparse, which is not installed.
cloud-init 0.7.6 requires cheetah, which is not installed.
cloud-init 0.7.6 requires oauth, which is not installed.
cloud-init 0.7.6 requires PrettyTable, which is not installed.
cloud-init 0.7.6 requires pyserial, which is not installed.


  

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

2 个答案:

答案 0 :(得分:0)

尝试使用sudo apt-get:

sudo apt-get build-dep python-matplotlib

答案 1 :(得分:0)

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

要安装,取决于您的发行版,但对我来说: FileOptions

之后,我还必须安装python dev的头文件:https://stackoverflow.com/a/21530768