我正在尝试安装shap包并继续获取以下错误
ModuleNotFoundError: No module named 'shap'
我已经在笔记本和终端上输入了以下内容
!conda install -c conda-forge shap
!conda install shap --yes下面是正在执行错误的行
!pip install shap
import shap
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X)我现在在Mac上
发布于 2020-08-30 16:50:40
关于的类似问题,.It可能会对您有所帮助。
Modules are installed using pip on OSX but not found when importing
如果上面的内容不起作用,请尝试如下:
安装git+https://github.com/slundberg/shap.git
如果上面的方法不起作用,那么也许是这样的:
要安装shapely (https://pypi.org/project/Shapely/)?在python中,您可以通过
pip install shapely对于windows,可以通过从.whl下载http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely并执行以下操作来安装沙普利
pip install <name of whl file>或者,如果你使用的是anaconda,你可以使用conda-forge来获得外形。
conda config --add channels conda-forge
conda install shapely发布于 2021-02-19 06:09:15
使用命令我也遇到了同样的问题。但是,conda安装成功了。我用麦克。
conda install -c conda-forge shap发布于 2021-10-09 09:38:21
我在上使用PIP21.2.4和Python3.8.9。我可以用下面的命令安装shap。
ARCHFLAGS="-arch x86_64“pip3安装形状
https://stackoverflow.com/questions/63659563
复制相似问题