我试图在我的Mac上安装Xgboost。 Python版本是3.6
sudo pip install xgboost
我收到以下错误
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
这就是发生的事情,我不知道发生了什么。
答案 0 :(得分:3)
答案 1 :(得分:1)
虽然我安装了gcc 5(使用brew),但xgboost版本仍然使用了gcc的LLVM版本(在我的例子中为7)。为了使构建使用gcc 5我做了:
$ brew install gcc5
$ env CC=gcc-5 CXX=g++-5 pip install xgboost
这对我有用。 (davidread's answer非常帮助我!谢谢你@davidread)
答案 2 :(得分:0)
我在使用pip进行安装时遇到了同样的问题,但是由link.
成功安装