Importing xgboost package in python

windows7
xgboost
python2
import

#1

Hi,

I’m new to python. I’m trying to import xgboost package in python 2, but not able to do it so far. Not able to find any good resources to get it done.

I’m using Windows 7, 64 bit machine with 6 GB RAM and i3 processor. Installed python 2.7 and Anaconda for python 2.7.

Are there any prerequisites to import xgboost ? Is there any step by step guide to import this ?

Please help !!

Thanks
Krishna


#2

Hello Krishna,

Clone this repo https://github.com/dmlc/xgboost and with your command prompt go to python folder of cloned folder then type
python setup.py install
this will do the job you wanted.


#3

Hi Gruby,

Thanks for your inputs. I’ve tried that already facing some issue with that. Attached are the screenshots showing the same.

Am I missing something ?

Thanks
Krishna


#4

Hi @krishna_cse37,

It’s really hard to get Xgboost installed on windows as general PIP doesn’t work. Even the above solution will not work. Read this Kaggle thread - the first post is your best bet.

I invested good 1-2 day to get it done. How I did it? Well I had binary version already made of XGboost package and I just made wrapper.dll file using Microsoft visual studio, following instruction on the mentioned Kaggle link. You need to build package using microsoft visual studio, which is a huge software with many addition dependencies(Took 2 - 3 GB of my internet pack).

Hope this helps.

Regards,
Aayush


#5

Hi Krishna,

As pointed out by @aayushmnit it is difficult to compile dll on windows…you may refer the link provided by Aayush or below one to get working binary for windows.

https://github.com/dmlc/xgboost/tree/master/windows


#6

Thanks @aayushmnit. I’ll try this and reply here.


#7

Thanks gruby. I’ll try this and reply.