7

I'm using Centos 7 and Python 2.7.5. The problem is when I install Pandas, i got this error message

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.

Community
  • 1
  • 1
Nurdin
  • 23,382
  • 43
  • 130
  • 308
  • Are you in a virtualenv? It looks like you're installing using `pip install pandas`, is this correct? What do you get when running `pip -V` and `python -V` inside and outside of the virtualenv (if applies)? – Sebastian Nov 12 '15 at 16:21
  • yes if not mistaken. I'm using Digital Ocean BTW. – Nurdin Nov 12 '15 at 16:24

8 Answers8

3

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.

WAYSER
  • 107
  • 1
  • 10
  • 1
    You should reference your answer if it is not your own answer! This answer can be found here: http://stackoverflow.com/questions/11425106/python-pip-install-fails-invalid-command-egg-info – Dataman Feb 27 '16 at 08:59
2

I already found the answer. I need to install python via RPM.

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/

Nurdin
  • 23,382
  • 43
  • 130
  • 308
1

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
1
pip install -- upgrade pip python -m pip install pandas
mosc9575
  • 5,618
  • 2
  • 9
  • 32
rafshaik
  • 19
  • 1
0

following link solved my problem

https://googleapis/google-cloud-python#3884

You should try pip install --upgrade setuptools.

Parag Jain
  • 612
  • 2
  • 14
  • 31
0

sudo apt-get install python-matplotlib

i used this when i got similar error during matplotlib install

reghu
  • 1
  • 2
0

simply execute this command :

sudo apt-get install python3.6-dev libmysqlclient-dev

0

I got this error while installing mysqlclient from pip3

So I executed command :

sudo apt-get install python3.6-dev libmysqlclient-dev

After executing this command i was able to install mysqlclient successfully

Note:- Version Number 3.6 is to be replaced by your python version

Muldec
  • 4,641
  • 1
  • 25
  • 44