Skip to content

Instantly share code, notes, and snippets.

@DanielBeckstein
Last active November 10, 2023 12:07
Show Gist options
  • 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
@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