[英]Python - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-21ft0H/pandas
I'm using Centos 7 and Python 2.7.5.我正在使用 Centos 7 和 Python 2.7.5。 The problem is when I install Pandas, i got this error message问题是当我安装 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
I already tried a lot of solutions but no success even yum -y update
.我已经尝试了很多解决方案,但即使yum -y update
也没有成功。
Distribute has been merged into Setuptools as of version 0.7.自 0.7 版起,Distribute 已合并到 Setuptools 中。 If you are using a version <=0.6, upgrade using pip install --upgrade setuptools
or easy_install -U setuptools
.如果您使用的是 <=0.6 版本,请使用pip install --upgrade setuptools
或easy_install -U setuptools
。
I already found the answer.我已经找到了答案。 I need to install python via RPM.我需要通过 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
Reference: http://blog.revivalx.com/2015/11/14/python-command-python-setup-py-egg_info-failed-with-error-code-1-tmppip-build-21ft0hpandas/参考: http : //blog.revivalx.com/2015/11/14/python-command-python-setup-py-egg_info-failed-with-error-code-1-tmppip-build-21ft0hpandas/
In my case for continuos integration work:就我的持续集成工作而言:
before_script:
- apk update && apk add python3-dev
- apk add --no-cache python3-dev libstdc++
- apk add --update curl gcc g++
- ln -s /usr/include/locale.h /usr/include/xlocale.h
- pip3 install numpy
- pip3 install pandas
- rm -rf /var/cache/apk/*
- python -V
- python -m pip install --upgrade pip
- python -m pip install --upgrade pip setuptools wheel --user --no-cache-dir
pip install -- upgrade pip python -m pip install pandas
following link solved my problem以下链接解决了我的问题
https://googleapis/google-cloud-python#3884 https://googleapis/google-cloud-python#3884
You should try pip install --upgrade setuptools.您应该尝试 pip install --upgrade setuptools。
sudo apt-get install python-matplotlib须藤 apt-get 安装 python-matplotlib
i used this when i got similar error during matplotlib install我在 matplotlib 安装过程中遇到类似错误时使用了这个
simply execute this command :只需执行此命令:
sudo apt-get install python3.6-dev libmysqlclient-dev sudo apt-get install python3.6-dev libmysqlclient-dev
I got this error while installing mysqlclient from pip3从 pip3 安装 mysqlclient 时出现此错误
So I executed command :所以我执行了命令:
sudo apt-get install python3.6-dev libmysqlclient-dev
After executing this command i was able to install mysqlclient successfully执行此命令后,我能够成功安装 mysqlclient
Note:- Version Number 3.6 is to be replaced by your python version注意:- 版本号 3.6 将替换为您的 python 版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.