python – ImportError: No module named xgboost

python – ImportError: No module named xgboost

First you need to get control of your python environment. Download the homebrew python by pasting these into a fresh terminal window

/usr/bin/ruby -e $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)

here you will be prompterd to enter your password. After homebrew is installed, install python with brew install python. Please check your installation with brew doctor and follow homebrews suggestions.

Now, with a fresh terminal window, install xgboost from pip. Open terminal and paste this in:

pip install xgboost

I had the same issue. I tried everything but the only solution that worked for me to was to install the whl file directly from here :
http://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost

then you can do :

pip install yourFile.whl

On windows I managed to just double click on the whl file and install it

Good luck

python – ImportError: No module named xgboost

FYI if you are using anaconda distn then need to do

conda install -c conda-forge xgboost

Leave a Reply

Your email address will not be published.