Python xgboost on mac install

I'm trying to install xgboost on my Mac for Python 3.4, but after installing "pip3 setup.py install" the following error appears:

File "<string>", line 20, in <module> File "/private/var/folders/_x/rkkz7tjj42g9n8lqq5r0ry000000gn/T/pip-build-2dc6bwf7/xgboost/setup.py", line 28, in <module> execfile(libpath_py, libpath, libpath) NameError: name 'execfile' is not defined 

When launched with the -v option to get verbose output, the error looks like this:

  Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_x/rkkz7tjj42g9n8lqq5r0ry000000gn/T/pip-build-2dc6bwf7/xgboost Exception information: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/basecommand.py", line 232, in main status = self.run(options, args) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/commands/install.py", line 339, in run requirement_set.prepare_files(finder) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/req/req_set.py", line 385, in prepare_files req_to_install.run_egg_info() File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/req/req_install.py", line 358, in run_egg_info command_desc='python setup.py egg_info') File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/utils/__init__.py", line 749, in call_subprocess % (command_desc, proc.returncode, cwd)) pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_x/rkkz7tjj42g9n8lqq5r0ry000000gn/T/pip-build-2dc6bwf7/xgboost 

How can I solve this problem?

+6
source share
3 answers

It worked for me.

OS: OSX El Capitan

Step-1: cd xgboost; ./build.sh cd xgboost; ./build.sh
Step 2: cd python-package; python setup.py install cd python-package; python setup.py install

+5
source

I think xgboost is only available as a Python 2 package for the package. There are two ways to make it work.

  • You are using Python 2 and installing it with pip.
  • You can manually create xgboost for Python 3. Just download the source from github and create it: Open Terminal. exit git: git clone https://github.com/dmlc/xgboost.git . build it: cd xgboost; make; cd wrapper; Install python.py install --user
+2
source

perhaps you should use

 cd xgboost; cp make/minimum.mk ./config.mk; make -j4 

instead

 cd xgboost; ./build.sh 

in accordance with the Build On OSX section of the assembly document

it's also possible it's a duplicate

0
source

All Articles