[报错解决]安装xgboost报错python setup.py egg_info Check the logs for full command output.

MacOS下安装xgboost和lightGBM报错,之前安装成功,换了python环境后安装失败

信息如下:
ERROR: Command errored out with exit status 1:
command: /Users/shuzip/opt/anaconda3/bin/python -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/tmp/pip-install-iebpqutp/xgboost/setup.py’"’"’; file=’"’"’/private/tmp/pip-install-iebpqutp/xgboost/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base pip-egg-info
cwd: /private/tmp/pip-install-iebpqutp/xgboost/
Complete output (27 lines):
++ pwd
+ oldpath=/private/tmp/pip-install-iebpqutp/xgboost
+ cd ./xgboost/
+ mkdir -p build
+ cd build
+ cmake …
./xgboost/build-python.sh: line 21: cmake: command not found
+ echo -----------------------------
-----------------------------
+ echo ‘Building multi-thread xgboost failed’
Building multi-thread xgboost failed
+ echo ‘Start to build single-thread xgboost’
Start to build single-thread xgboost
+ cmake … -DUSE_OPENMP=0
./xgboost/build-python.sh: line 27: cmake: command not found
Traceback (most recent call last):
File “”, line 1, in
File “/private/tmp/pip-install-iebpqutp/xgboost/setup.py”, line 42, in
LIB_PATH = libpath’find_lib_path’
File “/private/tmp/pip-install-iebpqutp/xgboost/xgboost/libpath.py”, line 50, 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/tmp/pip-install-iebpqutp/xgboost/xgboost/libxgboost.dylib
/private/tmp/pip-install-iebpqutp/xgboost/xgboost/…/…/lib/libxgboost.dylib
/private/tmp/pip-install-iebpqutp/xgboost/xgboost/./lib/libxgboost.dylib
/Users/shuzip/opt/anaconda3/xgboost/libxgboost.dylib
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

在这里插入图片描述

原因CMAKE掉了…

解决方案,重装CMAKE
建议安装方法:

brew install cmake

之后再执行pip install xgboost
pip install xgboost
解决。
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值