[英]XGboost installation error in Mac OS X Sierra
Am trying to install Xgboost on my Mac. 我正在尝试在Mac上安装Xgboost。 Python version is 3.6 Python版本是3.6
sudo pip install xgboost
am getting the following error 正在收到以下错误
Complete output from command python setup.py egg_info:
rm -f -rf build build_plugin lib bin *~ /~ //*~ ///~ /.o //*.o ///.o xgboost
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
make: * [build/learner.o] Error 127 make: Waiting for unfinished jobs.... clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d /bin/sh: clang-omp++: command not found make: [build/logging.o] Error 127 ----------------------------- Building multi-thread xgboost failed Start to build single-thread xgboost rm -f -rf build build_plugin lib bin *~ /~ //*~ ///~ /.o //*.o ///.o xgboost clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d /bin/sh: clang-omp++: command not found make: [build/learner.o] Error 127 make: Waiting for unfinished jobs.... clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d /bin/sh: clang-omp++: command not found make: * [build/logging.o] Error 127
Successfully build single-thread xgboost
If you want multi-threaded version
See additional instructions in doc/build.md
Traceback (most recent call last):
File "", line 1, in
File "/private/tmp/pip-build-TCLoWG/xgboost/setup.py", line 29, in
LIB_PATH = libpath'find_lib_path'
File "/private/tmp/pip-build-TCLoWG/xgboost/xgboost/libpath.py", line 45, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
builtin.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/private/tmp/pip-build-TCLoWG/xgboost/xgboost/libxgboost.so
/private/tmp/pip-build-TCLoWG/xgboost/xgboost/../../lib/libxgboost.so
/private/tmp/pip-build-TCLoWG/xgboost/xgboost/./lib/libxgboost.so
This is what happening, I don't know what's happening. 这就是发生的事情,我不知道发生了什么。
Do this: 做这个:
$ brew install gcc@5
$ pip install xgboost
Info here https://github.com/dmlc/xgboost/issues/1501 此处的信息https://github.com/dmlc/xgboost/issues/1501
Although I installed gcc 5 (with brew), the xgboost build still used the LLVM version of gcc (7 in my case). 尽管我安装了gcc 5(带有brew),但xgboost生成仍使用LLVM版本的gcc(在我的情况下为7)。 To get the build to use gcc 5 I did: 为了使构建使用gcc 5,我做到了:
$ brew install gcc5
$ env CC=gcc-5 CXX=g++-5 pip install xgboost
and this worked for me. 这对我有用。 ( davidread's answer helps me very much! thank you @davidread) ( davidread的回答对我很有帮助!谢谢@davidread)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.