我正在尝试安装azureml-interpret,但是我在安装azureml-interpret时遇到了问题。
运行pip install azureml-interpret
时,我得到:
ERROR: Command errored out with exit status 1:
command: 'C:UsersAlexAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Alex\AppData\Local\Temp\pip-install-k175gbg_\shap_1e1feac0fd27463fbfcdc6216c3f4c6f\setup.py'"'"'; __file__='"'"'C:\Users\Alex\AppData\Local\Temp\pip-install-k175gbg_\shap_1e1feac0fd27463fbfcdc6216c3f4c6f\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersAlexAppDataLocalTemppip-record-bu1hm3psinstall-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:UsersAlexAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39Includeshap'
cwd: C:UsersAlexAppDataLocalTemppip-install-k175gbg_shap_1e1feac0fd27463fbfcdc6216c3f4c6f
Complete output (64 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9shap
copying shapcommon.py -> buildlib.win-amd64-3.9shap
copying shapdatasets.py -> buildlib.win-amd64-3.9shap
copying shap__init__.py -> buildlib.win-amd64-3.9shap
creating buildlib.win-amd64-3.9shapexplainers
copying shapexplainersbruteforce.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainersexplainer.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainersgradient.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerskernel.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerslinear.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainersmimic.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerspartition.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerspermutation.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerspytree.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerssampling.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainerstree.py -> buildlib.win-amd64-3.9shapexplainers
copying shapexplainers__init__.py -> buildlib.win-amd64-3.9shapexplainers
creating buildlib.win-amd64-3.9shapexplainersother
copying shapexplainersothercoefficent.py -> buildlib.win-amd64-3.9shapexplainersother
copying shapexplainersotherlime.py -> buildlib.win-amd64-3.9shapexplainersother
copying shapexplainersothermaple.py -> buildlib.win-amd64-3.9shapexplainersother
copying shapexplainersotherrandom.py -> buildlib.win-amd64-3.9shapexplainersother
copying shapexplainersothertreegain.py -> buildlib.win-amd64-3.9shapexplainersother
copying shapexplainersother__init__.py -> buildlib.win-amd64-3.9shapexplainersother
creating buildlib.win-amd64-3.9shapexplainersdeep
copying shapexplainersdeepdeep_pytorch.py -> buildlib.win-amd64-3.9shapexplainersdeep
copying shapexplainersdeepdeep_tf.py -> buildlib.win-amd64-3.9shapexplainersdeep
copying shapexplainersdeep__init__.py -> buildlib.win-amd64-3.9shapexplainersdeep
creating buildlib.win-amd64-3.9shapplots
copying shapplotsbar.py -> buildlib.win-amd64-3.9shapplots
copying shapplotscolorconv.py -> buildlib.win-amd64-3.9shapplots
copying shapplotscolors.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsdecision.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsdependence.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsembedding.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsforce.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsforce_matplotlib.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsimage.py -> buildlib.win-amd64-3.9shapplots
copying shapplotsmonitoring.py -> buildlib.win-amd64-3.9shapplots
copying shapplotspartial_dependence.py -> buildlib.win-amd64-3.9shapplots
copying shapplotssummary.py -> buildlib.win-amd64-3.9shapplots
copying shapplotswaterfall.py -> buildlib.win-amd64-3.9shapplots
copying shapplots__init__.py -> buildlib.win-amd64-3.9shapplots
creating buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmarkexperiments.py -> buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmarkmeasures.py -> buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmarkmethods.py -> buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmarkmetrics.py -> buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmarkmodels.py -> buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmarkplots.py -> buildlib.win-amd64-3.9shapbenchmark
copying shapbenchmark__init__.py -> buildlib.win-amd64-3.9shapbenchmark
creating buildlib.win-amd64-3.9shapplotsresources
copying shapplotsresourcesbundle.js -> buildlib.win-amd64-3.9shapplotsresources
copying shapplotsresourceslogoSmallGray.png -> buildlib.win-amd64-3.9shapplotsresources
copying shaptree_shap.h -> buildlib.win-amd64-3.9shap
running build_ext
numpy.get_include() C:UsersAlexAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39site-packagesnumpycoreinclude
building 'shap._cext' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UsersAlexAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Alex\AppData\Local\Temp\pip-install-k175gbg_\shap_1e1feac0fd27463fbfcdc6216c3f4c6f\setup.py'"'"'; __file__='"'"'C:\Users\Alex\AppData\Local\Temp\pip-install-k175gbg_\shap_1e1feac0fd27463fbfcdc6216c3f4c6f\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersAlexAppDataLocalTemppip-record-bu1hm3psinstall-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:UsersAlexAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39Includeshap' Check the logs for full command output.
我也尝试过首先使用conda install -c conda-forge shap
来安装shap,然后尝试安装azureml-interpret,但我仍然有相同的问题
我有同样的问题,安装c++版本解决了这个问题。
见下文如何安装Visual c++构建工具?