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
如果这篇文章对你有用,请点个赞吧....