• Register
0 votes
446 views

Problem :

When I executed:

pip install xgboost

I got this:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/w4/w49s3mn91plbhyjwf8qjkpxc0000gn/T/pip-build-61dms1/xgboost/

6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

The installation instructions do explain how to get the mutli-threaded version of XGBoost. unfortunately they did not work for me.  The following is what worked for me.  i am sharing in case it helps others.  I had to perform the following step:

  • Get Homebrew if it is not installed yet.  Indeed, this is a very useful open source installer for OSX.  Instaling it is straightforward, open a terminal, then paste and execute the instruction available on Homebrew home page. I reproduce it here for convenience:
  • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Get gcc with open mp.  Just paste and execute the following command in your terminal, once Homebrew installation is completed.
  • brew install gcc --without-multilib    
    This automatically downloads and builds gcc.  It can take a while, it took about 30 minutes for me.  Be patient.
  • Get XGBoost.  Go to where you want in your filesystem, say <directoy>.  Then type the git clone command and execute it:
  • cd <directory>git clone --recursive https://github.com/dmlc/xgboost
    This downloads the XGBoost code into a new directory named xgboost.
  • Next step is to build XGBoost.  By default, the build process will use the default compilers, cc and c++, which do not support the open mp option used for XGBoost multi-threading. We need to tell the system to use the compiler we just installed.  That's the step that was missing from the installation instructions on XGBoost site. 
    There are various ways to do it, here is the one I used. 
  • Go to where we downloaded XGBoost
    cd <directory>/xgboost
  • Then open make/config.mk and uncomment these two lines
  • export CC = gcc
  • export CXX = g++
  • Depending on you g++ installaiton you may need to change the above two lines into:
    export CC = gcc-6
    export CXX = g++-6
  • We then build with the following commands.
  • cd <directory>/xgboost
  • cp make/config.mk .
  • make -j4
  • Once the build is finished, we can use XGBoost with its command line.  I am using Python, hence I performed this final step.  You may need to enter the admin password to execute it.
  • cd python-package; sudo python setup.py install

This concludes the installation. 

I tested it with My Anaconda distribution with Python 3.5.  It worked fine, and I could run XGBoost.  The speedup thanks to multi threading is noticeable, and my Mac Book Pro is now faster than my old PC.   

Further Readings:

9 7 4
38,600 points

Related questions

0 votes
1 answer 51 views
51 views
Problem: I am trying to install python package rpy2 with pip install on Ubuntu 16.04: pip install rpy2==2.2.7 but get error message (see full output below): Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-EuOI6K/unroll/
asked Jan 10 Mashhoodch 9.1k points
0 votes
3 answers 237 views
237 views
I am new in python programming. I am tryin gto iinstall some packages with pip commands. I tried to install a package called unroll by using the command: pip[ install unroll but it gives me some error like : "python setup.py egg_info" failed with error code 1 How can I solve this problem? How can I check my pip version? How can I upgrade my pip version?
asked Mar 9, 2020 LizzyM 6.1k points
0 votes
1 answer 6 views
6 views
command "python setup.py egg_info" failed with error code 1 in
asked Feb 16 ArifulIslam 7.5k points
2 votes
1 answer 38 views
38 views
Problem: I am new in programming language. I was trying to setup and then upgrade gcloud using python. I used the command: pip install --upgrade gcloud After that it shows: Collecting gcloud Downloading gcloud-0.18.3.tar.gz (454kB) 100% | ... code 1 in C:\Users\bid\AppData\Local\Temp\pip-build-ppc44asr\googleapis-common-protos\ Whats is happening here can anyone help?
asked Mar 24, 2020 LizzyM 6.1k points
1 vote
1 answer 25 views
25 views
Problem : Recently I have started learning Homebrew. Now if I try to run Homebrews brew doctor command on my Mac OS X 10.9.2 I have started receiving the below listed warning message: Warning: Python is installed at /Library/Frameworks/Python.framework Homebrew only ... /usr/local/bin/python. But still if I rerun the brew doctor command I am still facing the same warning message listed above.
asked Apr 4, 2020 morrisBson 3.2k points
0 votes
1 answer 7 views
7 views
Problem: error: (-215:assertion failed) !empty() in function 'cv::cascadeclassifier::detectmultiscale'
asked 5 days ago Lucky Guy 1.4k points
0 votes
2 answers 851 views
851 views
Problem : On installing Anaconda on Ubantu getting below Python error on miss-typed commands fatal python error: py_initialize: unable to get the locale encoding
asked Oct 21, 2019 peterlaw 6.9k points
0 votes
1 answer 4 views
4 views
Problem: I'm new to Python and have been trying to install some packages with pip. But pip install unroll gives me Command "python setup.py egg_info" failed with error code 1 in C:\Users\MARKAN~1\AppData\Local\Temp\pip-build-wa7uco0k\unroll\ How can I solve this?
asked 6 days ago Mashhoodch 9.1k points
1 vote
2 answers 4.2K views
4.2K views
Problem : Getting bellow python and django error 'virtualenv' is not recognized as an internal or external command, operable program or batch file.
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 1.4K views
1.4K views
Problem : I am using the sqlite3 to store the values into database, My problem is that I have created lineedits through which I am trying to extract values and store it to the variables and pass this variables to the insert query but i am facing below error at line values(?, ... ?,?,?)''',(self.uname,self.passwd,self.permssn)) print ('inserted row') self.createDb.commit() Any solution on my error?
asked Jan 18, 2020 jwilliam 3.9k points