Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

  • Can't install via pip because of egg_info error
  • Python pip install fails: invalid command egg_info
  • https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
  • pip fails to install anything, error: invalid command 'egg_info'
like image 964
Nurdin Avatar asked Nov 12 '15 16:11

Nurdin


3 Answers

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.

like image 131
WAYSER Avatar answered Oct 31 '22 17:10

WAYSER


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/

like image 2
Nurdin Avatar answered Oct 31 '22 19:10

Nurdin


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
like image 1
Victor Villacorta Avatar answered Oct 31 '22 17:10

Victor Villacorta