简体   繁体   中英

how to install xgboost easily on windows

i have been struggling with xgboost installation , i did many things but i can see this might work . I downloaded the file xgboost.rar and then extracted it into Lib/Site packages

now when i opening my site packages it is showing xgboost but when i import xgboost it says no module named xgboost .

please please help

from the documentation :

import os
os.environ['PATH'] = os.environ['PATH'] + ';C:\\Program Files\\mingw-w64\\x86_64-5.3.0-posix-seh-rt_v4-rev0\\mingw64\\bin'

You can pip install catboost. It is a recently open-sourced gradient boosting library, which has similar interfaces, is in most cases more accurate and faster than XGBoost, and it has categorical features support. Here is the site of the library: https://catboost.yandex

You first need to build the library through "make", then you can install using anaconda prompt (if you want it on anaconda) or git bash (if you use it in Python only).

First follow the official guide with the following procedure (in Git Bash on Windows):

git clone --recursive https://github.com/dmlc/xgboost
git submodule init
git submodule update

then install TDM-GCC here and do the following in Git Bash:

alias make='mingw32-make' cp make/mingw64.mk config.mk; make -j4

Last, do the following using anaconda prompt or Git Bash:

cd xgboost\\python-package
python setup.py install

Also refer to these great resources:

Official Guide

Installing Xgboost on Windows

Installing XGBoost For Anaconda on Windows

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM