如何为Python(Jupyter笔记本)下载/安装xgboost

当我运行pip install xgboost时,出现了下面的错误。我认为还有另外一种使用git的方法?但我不知道具体该怎么做(一步一步的),我对这些还不太熟悉。非常感谢您的帮助

192-168-1-10:Desktop yadav_sa$ pip 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        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        make: *** [build/learner.o] Error 127        make: *** Waiting for unfinished jobs....        /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 "<string>", line 1, in <module>          File "/private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/setup.py", line 29, in <module>            LIB_PATH = libpath['find_lib_path']()          File "/private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/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/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/libxgboost.so        /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/../../lib/libxgboost.so        /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/./lib/libxgboost.so        ----------------------------------------    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/

我需要这个包来进行Python机器学习。我使用的是Mac。enter image description here

我按照官方安装指南进行了操作,但收到了错误提示。

192-168-1-10:xgboost yadav_sa$ cd xgboost; cp make/config.mk ./config.mk; make -j4-bash: cd: xgboost: Not a directoryc++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -o xgboost  build/cli_main.o build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/common/hist_util.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_fast_hist.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a  -pthread -lm  -fopenmp c++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -shared -o lib/libxgboost.so build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/common/hist_util.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_fast_hist.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm  -fopenmp ar crv lib/libxgboost.a ar: no archive members specifiedusage:  ar -d [-TLsv] archive file ...    ar -m [-TLsv] archive file ...    ar -m [-abiTLsv] position archive file ...    ar -p [-TLsv] archive [file ...]    ar -q [-cTLsv] archive file ...    ar -r [-cuTLsv] archive file ...    ar -r [-abciuTLsv] position archive file ...    ar -t [-TLsv] archive [file ...]    ar -x [-ouTLsv] archive [file ...]make: *** [lib/libxgboost.a] Error 1make: *** Waiting for unfinished jobs....clangclang: : error: error: unsupported option '-fopenmp'unsupported option '-fopenmp'make: *** [lib/libxgboost.so] Error 1make: *** [xgboost] Error 1

回答:

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注