How can I install XGBoost package in python on Windows

shan picture shan · Feb 19, 2016 · Viewed 48.1k times · Source

I tried to install XGBoost package in python. I am using windows os, 64bits . I have gone through following.

The package directory states that xgboost is unstable for windows and is disabled: pip installation on windows is currently disabled for further invesigation, please install from github. https://pypi.python.org/pypi/xgboost/

I am not well versed in Visual Studio, facing problem building XGBoost. I am missing opportunities to utilize xgboost package in data science.

Please guide, so that I can import the XGBoost package in python.

Thanks

Answer

Adrian Torrie picture Adrian Torrie · Jul 31, 2017

If you are using anaconda (or miniconda) you can use the following:

  • conda install -c anaconda py-xgboost UPDATED 2019-09-20
  • Docs

Check install by:

  • Activating the environment (see below)
  • Running conda list

To activate an environment:

On Windows, in your Anaconda Prompt, run (assumes your environment is named myenv):

  • activate myenv

On macOS and Linux, in your Terminal Window, run (assumes your environment is named myenv):

  • source activate myenv

Conda prepends the path name myenv onto your system command.