1

I'm trying to install xgboost in an Ubuntu 16.04 virtual machine.

I'm following this guide and ran this command:

cmake ..

I got this error:

-bash: cmake: command not found

What am I doing wrong and how can I get rid of this error?

Malekai
  • 4,765
  • 5
  • 25
  • 60

2 Answers2

1

Try this:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:george-edison55/cmake-3.x
sudo apt-get update 
sudo apt-get install cmake

UPDATE: Or you can just use pip:

sudo pip3 install xgboost
mighty_mike
  • 714
  • 7
  • 19
0

It appears you're getting this error because you don't have the cmake command installed, you can fix this by running:

sudo apt install cmake

I don't know if you've missed this but you can also install xgboost using pip (or in your case pip3), like this:

pip3 install xgboost

NOTE: depending on how your user/project is set up you might need to use the sudo command to grant pip3 write privileges to certain (root) directories, if this is the case, you'd use:

sudo pip3 install xgboost

NOTE: if you don't have pip3 installed, you can install it using:

sudo apt install python3 python3-pip

Good luck.

Malekai
  • 4,765
  • 5
  • 25
  • 60
  • Thank you, using sudo pip3 install xgboost now it works !!! So for the future installation of a package you suggest to me to use pip3 ? – Davide Aureli Apr 24 '19 at 08:32
  • 1
    You're very welcome and if what you're using is a Python library, then yes, I'd suggest using `pip3 search` to look for it, for example `pip3 search flask` would return a list of packages that contain the keyword *"flask"*, you could do the same for *"xgboost"* or any other package you wanted to install. – Malekai Apr 24 '19 at 08:34