Mac OS Sierra에서 Python3.6에 XGBoost 설치하는 방법 입니다.

#아래 방법으로 설치를 진행
pip3 install xgboost

아래와 같은 오류 메시지가 나올 경우

Collecting xgboost
  Using cached xgboost-0.6a2.tar.gz
    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: INTERNAL: Exiting with 5 jobserver tokens available; should be 4!
    -----------------------------
    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/var/folders/wm/ttz1n3_5411_9mgbq9374b740000gn/T/pip-build-ygddgcjq/xgboost/setup.py", line 29, in 
        LIB_PATH = libpath['find_lib_path']()
      File "/private/var/folders/wm/ttz1n3_5411_9mgbq9374b740000gn/T/pip-build-ygddgcjq/xgboost/xgboost/libpath.py", line 45, in find_lib_path
        'List of candidates:\n' + ('\n'.join(dll_path)))
    XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
    List of candidates:
    /private/var/folders/wm/ttz1n3_5411_9mgbq9374b740000gn/T/pip-build-ygddgcjq/xgboost/xgboost/libxgboost.so
    /private/var/folders/wm/ttz1n3_5411_9mgbq9374b740000gn/T/pip-build-ygddgcjq/xgboost/xgboost/../../lib/libxgboost.so
    /private/var/folders/wm/ttz1n3_5411_9mgbq9374b740000gn/T/pip-build-ygddgcjq/xgboost/xgboost/./lib/libxgboost.so
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/wm/ttz1n3_5411_9mgbq9374b740000gn/T/pip-build-ygddgcjq/xgboost/

brew를 통해 gcc 5를 설치해줘야 한다

#gcc 5 설치후
brew install gcc5

#xgboost 설치 진행
pip3 install xgboost
카테고리: Development Tip

0개의 댓글

댓글 남기기

아바타 플레이스홀더

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다