Python - 命令“python setup.py egg_info”在 /tmp/pip-build-21ft0H/pandas 中失败,错误代码为 1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33676113/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Python - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-21ft0H/pandas
提问by Mohammad Nurdin
I'm using Centos 7 and Python 2.7.5. The problem is when I install Pandas, i got this error message
我正在使用 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
I already tried a lot of solutions but no success even yum -y update
.
我已经尝试了很多解决方案,但都没有成功yum -y update
。
采纳答案by Mohammad Nurdin
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
参考:http: //blog.revivalx.com/2015/11/14/python-command-python-setup-py-egg_info-failed-with-error-code-1-tmppip-build-21ft0hpandas/
回答by WAYSER
Distribute has been merged into Setuptools as of version 0.7. If you are using a version <=0.6, upgrade using pip install --upgrade setuptools
or easy_install -U setuptools
.
自 0.7 版起,Distribute 已合并到 Setuptools 中。如果您使用的是 <=0.6 版本,请使用pip install --upgrade setuptools
或升级easy_install -U setuptools
。
回答by Parag Jain
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。
回答by reghu
sudo apt-get install python-matplotlib
须藤 apt-get 安装 python-matplotlib
i used this when i got similar error during matplotlib install
我在 matplotlib 安装过程中遇到类似错误时使用了这个
回答by Nitesh Sharma
simply execute this command :
只需执行此命令:
sudo apt-get install python3.6-dev libmysqlclient-dev
sudo apt-get install python3.6-dev libmysqlclient-dev
回答by Victor Villacorta
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
回答by LOKESH MAHALA
I got this error while installing mysqlclient from pip3
从 pip3 安装 mysqlclient 时出现此错误
So I executed command :
所以我执行了命令:
sudo apt-get install python3.6-dev libmysqlclient-dev
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 版本