QBoard » Artificial Intelligence & ML » AI and ML - Python » How can I install XGBoost package in python on Windows

How can I install XGBoost package in python on Windows

  • 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

     
      October 18, 2021 2:07 PM IST
    0
  • XGBoost is used in Applied Machine Learning and is known for its gradient boost algorithm and it is available as a library in python but has to be compiled using cmake.

    Alternatively what you can do is from this link you can download the C pre-compiled library and install it using the pip install < FILE-NAME.whl> command. Ensure you have downloaded the library which is compatible with your python version.

    I experienced this problem while I was using the same in Anaconda(Spyder). Then just restart the kernel and your error will go away.

      December 1, 2021 2:57 PM IST
    0
  • Build it from here:
    • download xgboost whl file from here (make sure to match your python version and system architecture, e.g. "xgboost-0.6-cp35-cp35m-win_amd64.whl" for python 3.5 on 64-bit machine)
    • open command prompt
    • cd to your Downloads folder (or wherever you saved the whl file) pip install xgboost-0.6-cp35-cp35m-win_amd64.whl (or whatever your whl file is named)
      October 19, 2021 6:26 PM IST
    0
    1. download xgboost whl file from here (make sure to match your python version and system architecture, e.g. "xgboost-0.6-cp35-cp35m-win_amd64. whl" for python 3.5 on 64-bit machine)
    2. open command prompt.
    3. cd to your Downloads folder (or wherever you saved the whl file)
    4. pip install xgboost-0.6-cp35-cp35m-win_amd64.
      November 13, 2021 2:27 PM IST
    0
  • Adding "git checkout 9a48a40" to Disco4Ever's solution above worked for me:
    git clone --recursive https://github.com/dmlc/xgboost cd xgboost git checkout 9a48a40 git submodule init git submodule update
    This was originally posted by Cortajarena here: https://github.com/dmlc/xgboost/issues/1267
    Also, for what it's worth, I originally had 32 bit Python running on my 64 bit machine and I had to upload 64 bit Python for XGBoost to work.
      October 20, 2021 3:32 PM IST
    0