alanbecklesmd
alanbecklesmd

Reputation: 1

OSError when importing XGBoost

I have installed XGBoost using sudo pip install. When I attempt to lmport I receive an OSError library not loaded, image not found. I have installed Xcode and my compiler is clack. When I enter clack at the command line I receive another error: no input files possibly suggesting $PATH may need to be modified. How can $PATH be modified and will this allow XGBoost to be loaded properly?

Upvotes: 0

Views: 524

Answers (1)

AbdealiLoKo
AbdealiLoKo

Reputation: 3337

The error saying no input files means you haven't given it any input files to compile. This is an expected error which even gcc, clang, etc. give. So, I do not think this is the correct debug step for your problem.

With pypi

When installing xgboost using pip on OSX, I receive an error saying clang-omp++ was not found. And eventually gives an error __builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?. So, it has some bug and can't be installed it seems.

And this seems to be a known issue: https://github.com/dmlc/xgboost/issues/1446#issuecomment-239655078

Working method

This is how I got xgboost to be installed:

git clone --recursive https://github.com/dmlc/xgboost.git
cd xgboost
cp make/minimum.mk config.mk
make -j

This works using the builtin clang compiler as well as gcc from brew. For more info read https://xgboost.readthedocs.io/en/latest/build.html#building-on-osx

Now to install the python package:

cd python-package
python setup.py install

Read more at https://xgboost.readthedocs.io/en/latest/build.html#python-package-installation . Note that the python setup.py install may need sudo if you aren't using a virtualenv.

Upvotes: 1

Related Questions