gpt4 book ai didi

python - 形状安装

转载 作者:行者123 更新时间:2023-12-04 11:32:43 25 4
gpt4 key购买 nike

尝试在 python 虚拟环境中安装商店时遇到问题。特别是当

pip install shap
出现以下错误:
 ERROR: Command errored out with exit status 1:
command: /Users/federiconutarelli/Desktop/Riccaboni_python/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-install-snwg2_4s/shap_4dbdc5c8e74a45cca2a3aa06af49ba31/setup.py'"'"'; __file__='"'"'/private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-install-snwg2_4s/shap_4dbdc5c8e74a45cca2a3aa06af49ba31/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 /private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-wheel-nnajc046
cwd: /private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-install-snwg2_4s/shap_4dbdc5c8e74a45cca2a3aa06af49ba31/
Complete output (224 lines):
The nvcc binary could not be located in your $PATH. Either add it to your path, or set $CUDAHOME to enable CUDA
Error building cuda module: TypeError('cannot unpack non-iterable NoneType object')
WARNING: Could not compile cuda extensions
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14.6-x86_64-3.8
creating build/lib.macosx-10.14.6-x86_64-3.8/shap
copying shap/datasets.py -> build/lib.macosx-10.14.6-x86_64-3.8/shap
copying shap/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/shap
copying shap/links.py -> build/lib.macosx-10.14.6-x86_64-3.8/shap ...
(它比那更长,但我为了可读性而剪掉了它)。此外,conda 安装在执行事务时会卡住。据我了解,问题在于 Shapiros 依赖于 CUDA。但是也在将 CUDA 设置为路径之后
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64

PATH=${CUDA_HOME}/bin:${PATH}
export PATH
错误仍然存​​在。我正在开发一个 python 虚拟环境。我知道 anaconda 应该提供 CUDA,但 anaconda 似乎也卡住了(每个命令都被“解决环境”吸引了。
我该如何解决这个问题?
谢谢你们。

最佳答案

尝试安装 python3 dev。
对于 ubuntu

sudo apt -y install python3-dev
对于 Centos
sudo yum -y install python3-devel
编辑:如果您使用的是特定版本的 python
sudo apt -y install python3.7-dev
确保 dev 版本和 python 版本相同

关于python - 形状安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65886291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com