Mac OS へ XGBoost をインストールしたいのですが、うまくいきません...
###試したこと
まず
terminal
1brew install gcc@5 2pip install xgboost
というコマンドを打ちました。すると、
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/k0/r2yklh0d65g2cy4tk31r67x00000gn/T/pip-install-fq6vnnbh/xgboost/
と言うエラーを吐かれ、その後調べながら
terminal
1export CC=gcc-5 2export CXX=g++-5 3 4pip install --upgrade pip setuptools 5 6xcode-select --install
といったコマンドを試してから再び
terminal
1pip install xgboost
を実行したのですが、やはり上と同じようなエラーを吐かれてしまいます。
詳しい方がいましたら、解決方法を教えていただきたいです。
######追加補足
エラー文に以下のような文もありました。
/usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cwchar:44:19: fatal error: wchar.h: No such file or directory compilation terminated. make: *** [build/c_api/c_api_error.o] Error 1 make: *** Waiting for unfinished jobs.... g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP src/c_api/c_api.cc -o build/c_api/c_api.o In file included from dmlc-core/include/dmlc/logging.h:10:0, from include/xgboost/logging.h:11, from src/logging.cc:7: /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cstdio:42:19: fatal error: stdio.h: No such file or directory compilation terminated. make: *** [build/logging.o] Error 1 In file included from include/xgboost/data.h:10:0, from src/c_api/c_api.cc:3: dmlc-core/include/dmlc/base.h:194:23: fatal error: sys/types.h: No such file or directory compilation terminated. make: *** [build/c_api/c_api.o] Error 1 g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP src/learner.cc -o build/learner.o In file included from dmlc-core/include/dmlc/io.h:8:0, from src/learner.cc:7: /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cstdio:42:19: fatal error: stdio.h: No such file or directory compilation terminated. make: *** [build/learner.o] Error 1 Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/k0/r2yklh0d65g2cy4tk31r67x00000gn/T/pip-install-fq6vnnbh/xgboost/setup.py", line 42, in <module> LIB_PATH = libpath['find_lib_path']() File "/private/var/folders/k0/r2yklh0d65g2cy4tk31r67x00000gn/T/pip-install-fq6vnnbh/xgboost/xgboost/libpath.py", line 49, in find_lib_path 'List of candidates:\n' + ('\n'.join(dll_path))) XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path? List of candidates: /private/var/folders/k0/r2yklh0d65g2cy4tk31r67x00000gn/T/pip-install-fq6vnnbh/xgboost/xgboost/libxgboost.dylib /private/var/folders/k0/r2yklh0d65g2cy4tk31r67x00000gn/T/pip-install-fq6vnnbh/xgboost/xgboost/../../lib/libxgboost.dylib /private/var/folders/k0/r2yklh0d65g2cy4tk31r67x00000gn/T/pip-install-fq6vnnbh/xgboost/xgboost/./lib/libxgboost.dylib /anaconda3/xgboost/libxgboost.dylib
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。