XGBoostLibraryNotFound: cannot find the XGBoost library in the candidate path, did you install the compilers and run build.sh in the root path?

I ran into this problem when moving the python package directory of XGBoost.

Traceback (most recent call last): File "setup.py", line 19, in LIB_PATH = libpath'find_lib_path' File "xgboost/libpath.py", line 46, in find_lib_path 'List of candidates:\n' + ('\n'.join(dll_path))) builtin.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path? 

Can someone explain to me how to fix this? thanks in advance.

+7
python xgboost anaconda
source share
4 answers

You get this message when you try to install the Python xgboost package without the xgboost binaries present. The correct way to install the Python xgboost package from the source is as follows (if you have a compiler like gcc ):

 git clone --recursive https://github.com/dmlc/xgboost.git cd xgboost ./build.sh cd python-package python setup.py install 

I prefer to do this in a virtual environment. Please note that the option - recursive when cloning a repo is important, as it also clones folders from different repositories, such as dmlc-core , which are necessary for building xgboost.

+6
source share

The first sentences of the answer did not work for me and left me the same error as the original question.

If I assume that your complete error message looks something like this:

 C:\Users\Matt\xgboost\python-package>python setup.py install Traceback (most recent call last): File "setup.py", line 19, in <module> LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()] File "xgboost/libpath.py", line 49, in find_lib_path 'List of candidates:\n' + ('\n'.join(dll_path))) XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path? List of candidates: C:\Users\Matt\xgboost\python-package\xgboost\xgboost.dll C:\Users\Matt\xgboost\python-package\xgboost\../../lib/xgboost.dll C:\Users\Matt\xgboost\python-package\xgboost\./lib/xgboost.dll C:\Users\Matt\AppData\Local\Programs\Python\Python35\xgboost\xgboost.dll C:\Users\Matt\xgboost\python-package\xgboost\../../windows/x64/Release/xgboost.dll C:\Users\Matt\xgboost\python-package\xgboost\./windows/x64/Release/xgboost.dll 

then the solution has the form

1) Get / find / download the library that setup.py is looking for. Locate the xgboost folder for the .dll files. See if you can find something like xgboost.dll , which can be called libxgboost.dll . If you can, go to step 2. If you cannot find it, download it here.

2) Copy the .dll file to the xgboost / python-package / xgboost folder. If this .dll is not called xgboost.dll (i.e. if it is called libxgboost.dll), change it to xgboost.dll

3) Run the commands as indicated in Gustavo's answer. Please note that they are designed to work from Git Bash.

If you want more nutshell tutorial, this was the best I have found.

+2
source share

thanks to Joe Nyland , who found a good answer for this problem.
According to him (and also worked for me) you need to execute the following commands:

  $ brew install gcc@5 $ pip install xgboost 
+2
source share

Other answers did not work for me, so I installed xgboost via Conda commands as specified here .

Just run conda install -c conda-forge xgboost

0
source share

All Articles