Python - 命令"python setup.py egg_info"失败,错误代码1在/ tmp/pip-build-21ft0H/pandas

Moh*_*din 7 python pandas centos7

我正在使用Centos 7和Python 2.7.5.问题是当我安装Pandas时,我收到此错误消息

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-21ft0H/pandas
Run Code Online (Sandbox Code Playgroud)

我已经尝试了很多解决方案但是没有成功yum -y update.

Moh*_*din 2

我已经找到答案了。我需要通过 RPM 安装 python。

rpm -i ftp://195.220.108.108/linux/centos/7.1.1503/updates/x86_64/Packages/python-2.7.5-18.el7_1.1.x86_64.rpm
Run Code Online (Sandbox Code Playgroud)

参考:http://blog.revivalx.com/2015/11/14/python-command-python-setup-py-egg_info-failed-with-error-code-1-tmppip-build-21ft0hpandas/

  • 那“yum install python-matplotlib”对我来说怎么样呢? (2认同)