Um blog sobre nada

Um conjunto de inutilidades que podem vir a ser úteis

Easiest way to install xgboost on windows (download binaries – no need to compile )

Posted by Diego em Abril 5, 2017


1) (I am assuming both git and Anaconda are already installed).

2) Choose a place to have the installer files and clone the git repo:

 

git clone https://github.com/dmlc/xgboost.git xgboost_install

clip_image002

 

 

3) Download the libxgboost.dll file from here and copy it to the xgboost folder on: <install_dir>\python-package\xgboost\

 

clip_image004

 

 

4) Navigate to the python_package folder and run:

python setup.py install

clip_image006

That should work fine.

If, however, you get the error bellow – like I did – when trying to import the library:

 

 

WindowsError: [Error 126] The specified module could not be found

 

here’s what I recommend:

After some debugging I found out the problem was on the from .core import DMatrix, Booster command, more specifically, on the “_load_lib()” function inside Core trying to run this line:

 

lib = ctypes.cdll.LoadLibrary(lib_path[0])

 

where lib_path[0] was precisely the file path for the libxgboost.dll I had just copied to the xgboost folder.

Since I was sure the file existed, I realized that maybe the DLL depended on other DLLs that could not be found. To check that, I downloaded dependency walker from this link, which showed me that the required VCOMP140.DLL was missing:

 

 

image

 

 

 

After some goggling, I discovered that the most common cause for that is that my machine did not have the C++ runtime installed, which I downloaded from here and eventually solved my problem:

image

 

Anúncios

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da WordPress.com

Está a comentar usando a sua conta WordPress.com Terminar Sessão /  Alterar )

Google+ photo

Está a comentar usando a sua conta Google+ Terminar Sessão /  Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão /  Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão /  Alterar )

Connecting to %s

 
%d bloggers like this: