pip安装shap报错
Posted _刘文凯_
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pip安装shap报错相关的知识,希望对你有一定的参考价值。
python pip install shap 报错 error ERROR: Command errored out with exit status 1:
linux pip安装shap 报错 Building wheel for shap (setup.py) … error ERROR: Command errored out with exit status 1: command: /usr/python/anaconda3/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-g0yvh0xs/shap_cdc81c9cd7784671b7edc8e56d244549/setup.py’"’"’; file=’"’"’/tmp/pip-install-g0yvh0xs/shap_cdc81c9cd7784671b7edc8e56d244549/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\\r\\n’"’"’, ‘"’"’\\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /tmp/pip-wheel-y3wnvdej cwd: /tmp/pip-install-g0yvh0xs/shap_cdc81c9cd7784671b7edc8e56d244549/ error: command ‘gcc’ failed with exit status 1
原因:
缺少cpp
解决:
安装cpp
> sudo apt install build-essential # ubuntu
> sudo yum install build-essential # centos
结果:
> pip install shap
如果这篇文章对你有用,请点个赞吧....
以上是关于pip安装shap报错的主要内容,如果未能解决你的问题,请参考以下文章
安装升级pip,但是python -m pip install --upgrade pip报错