Skip to content

Instantly share code, notes, and snippets.

@DanielBeckstein
Last active November 10, 2023 12:07
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save DanielBeckstein/932087ee116cc2f72bfc6e3e078e899d to your computer and use it in GitHub Desktop.
Save DanielBeckstein/932087ee116cc2f72bfc6e3e078e899d to your computer and use it in GitHub Desktop.
How to install xgboost for Python on Linux
@pallabi68
Copy link

pallabi@pallabi-HP-Notebook ~/xgboost/python-package $ python setup.py install --user
Traceback (most recent call last):
File "setup.py", line 6, in
from setuptools import setup, find_packages
ImportError: No module named setuptools

@daniel060896
Copy link

pallabi68, try using python3 instead of python, typing the following in the terminal:
$ python3 setup.py install --user

@Pooja199
Copy link

It fails at the make step with the following error:
/usr/include/c++/7/parallel/tags.h:36:10: fatal error: omp.h: No such file or directory
#include <omp.h>
^~~~~~~
compilation terminated.
make: *** [amalgamation/xgboost-all0.o] Error 1
Using: gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

@duttabhishek0
Copy link

When I install it using python3, I get the following error
error: [Errno 2] No such file or directory: 'cmake'

@AnubhavCR7
Copy link

@duttabhishek0
Even I am getting the same error while installing on a Linux Server. Were you able to find any workaround for this ?
I am trying to install on Ubuntu 18.04.5 LTS Server, Python 3.6.9

Regards.

@sivakumar1604
Copy link

To resolve cmake error..run this "sudo pip3 install cmake" (version should >14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment