Dealing with compiler problems when installing XGBoost on mac os x 10.12
XGBoost is a sexy library in machine learning, currently performing very well in the last kaggle competitions. This post doesn't intend to describe the machinery of the XGBoost, but rather to relate the issues I faced during the installation of the XGBoost python package.
The holy pip command
According to the XGBoost main page:
pip install xgboost
should do the work... but it didn't, at least in my environment. Got the following error:
Obtaining file:///Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package/setup.py", line 19, in <module>
LIB_PATH = libpath['find_lib_path']()
File "/Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package/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?
List of candidates:
/Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package/xgboost/libxgboost.so
/Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package/xgboost/../../lib/libxgboost.so
/Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package/xgboost/./lib/libxgboost.so
/Users/greghor/anaconda2/xgboost/libxgboost.so
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/python-package/
I started to look at this egg_info error, consequently updating the corresponding components but it didn't fix my issues.
Manual installation to account for multithreading
cd bin/usr/
This last step finally fixed my issues. XGBoost is now working like a charm! Kaggle folks, watch out your ass! Here I come!