使用 "pip3 install xgboost" 安装时出错

Error when installing using "pip3 install xgboost"

我试着遵循这个指南:https://xgboost.readthedocs.io/en/latest/build.html 但是我收到了这些错误消息。有什么见解吗?

(base) MacBook-Pro-2:~ Prajnajiang$ pip3 install xgboost 收集 xgboost 使用缓存的 xgboost-1.0.2.tar.gz (821 kB) 错误:命令出错,退出状态为 1: 命令:/Users/apple/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/setup.py'"'"'; file='"'"'/private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',打开)(文件);code=f.read().replace('"'"'\r\n'"'"', '"'"'\ n'"'"');f.close();exec(编译(代码, 文件, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/pip-egg-info cwd: /private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/ 完整输出(27 行): ++密码 + 旧路径=/private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost + cd ./xgboost/ + mkdir -p 构建 + 光盘构建 + 制作 .. ./xgboost/build-python.sh:第 21 行:cmake:找不到命令 +回声---------------------------- ------------------------------ +回声'Building multi-thread xgboost failed' 构建多线程 xgboost 失败 +回声'Start to build single-thread xgboost' 开始构建单线程xgboost + 制作 .. -DUSE_OPENMP=0 ./xgboost/build-python.sh:第 27 行:cmake:找不到命令 追溯(最近一次通话): 文件“”,第 1 行,位于 文件“/private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/setup.py”,第 42 行,位于 LIB_PATH = libpath'find_lib_path' 文件“/private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/xgboost/libpath.py”,第 50 行,在 find_lib_path 'List of candidates:\n' + ('\n'.join(dll_path))) XGBoostLibraryNotFound:在候选路径中找不到 XGBoost 库,您是否在根路径中安装了编译器和 运行 build.sh? 候选人名单: /private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/xgboost/libxgboost.dylib /private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/xgboost/../../lib/libxgboost.dylib /private/var/folders/5y/6cyzpgbx7895mzf3wfvryvrr0000gn/T/pip-install-quq3h_3t/xgboost/xgboost/./lib/libxgboost.dylib /Users/apple/opt/anaconda3/xgboost/libxgboost.dylib -------------------------------------- 错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出。

问题已解决: 问题是我没有安装 cmake。安装cmake后问题解决