【问题标题】:Multiple errors while trying to install azureml-interpret尝试安装 azureml-interpret 时出现多个错误
【发布时间】:2021-02-16 11:08:46
【问题描述】:

我目前正在尝试安装 azureml-interpret,但我遇到了 shap azureml-interpret 的问题。

在运行pip install azureml-interpret 时,我得到了:

ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Alex\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alex\AppData\Local\Temp\pip-record-bu1hm3ps\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Alex\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\shap'
         cwd: C:\Users\Alex\AppData\Local\Temp\pip-install-k175gbg_\shap_1e1feac0fd27463fbfcdc6216c3f4c6f\
    Complete output (64 lines):

    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\shap
    copying shap\common.py -> build\lib.win-amd64-3.9\shap
    copying shap\datasets.py -> build\lib.win-amd64-3.9\shap
    copying shap\__init__.py -> build\lib.win-amd64-3.9\shap
    creating build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\bruteforce.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\explainer.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\gradient.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\kernel.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\linear.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\mimic.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\partition.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\permutation.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\pytree.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\sampling.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\tree.py -> build\lib.win-amd64-3.9\shap\explainers
    copying shap\explainers\__init__.py -> build\lib.win-amd64-3.9\shap\explainers
    creating build\lib.win-amd64-3.9\shap\explainers\other
    copying shap\explainers\other\coefficent.py -> build\lib.win-amd64-3.9\shap\explainers\other
    copying shap\explainers\other\lime.py -> build\lib.win-amd64-3.9\shap\explainers\other
    copying shap\explainers\other\maple.py -> build\lib.win-amd64-3.9\shap\explainers\other
    copying shap\explainers\other\random.py -> build\lib.win-amd64-3.9\shap\explainers\other
    copying shap\explainers\other\treegain.py -> build\lib.win-amd64-3.9\shap\explainers\other
    copying shap\explainers\other\__init__.py -> build\lib.win-amd64-3.9\shap\explainers\other
    creating build\lib.win-amd64-3.9\shap\explainers\deep
    copying shap\explainers\deep\deep_pytorch.py -> build\lib.win-amd64-3.9\shap\explainers\deep
    copying shap\explainers\deep\deep_tf.py -> build\lib.win-amd64-3.9\shap\explainers\deep
    copying shap\explainers\deep\__init__.py -> build\lib.win-amd64-3.9\shap\explainers\deep
    creating build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\bar.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\colorconv.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\colors.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\decision.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\dependence.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\embedding.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\force.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\force_matplotlib.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\image.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\monitoring.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\partial_dependence.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\summary.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\waterfall.py -> build\lib.win-amd64-3.9\shap\plots
    copying shap\plots\__init__.py -> build\lib.win-amd64-3.9\shap\plots
    creating build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\experiments.py -> build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\measures.py -> build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\methods.py -> build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\metrics.py -> build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\models.py -> build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\plots.py -> build\lib.win-amd64-3.9\shap\benchmark
    copying shap\benchmark\__init__.py -> build\lib.win-amd64-3.9\shap\benchmark
    creating build\lib.win-amd64-3.9\shap\plots\resources
    copying shap\plots\resources\bundle.js -> build\lib.win-amd64-3.9\shap\plots\resources
    copying shap\plots\resources\logoSmallGray.png -> build\lib.win-amd64-3.9\shap\plots\resources
    copying shap\tree_shap.h -> build\lib.win-amd64-3.9\shap
    running build_ext
    numpy.get_include() C:\Users\Alex\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\core\include
    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:\Users\Alex\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alex\AppData\Local\Temp\pip-record-bu1hm3ps\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Alex\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\shap' Check the logs for full command output.

我也尝试过先使用conda install -c conda-forge shap 安装 shap,然后尝试安装 azureml-interpret,但我仍然遇到同样的问题

【问题讨论】:

  • error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ --> 你安装了 C++ 构建工具吗?
  • 是的,我做到了,我得到了同样的错误
  • 在此处被推荐为类似问题,为 shap 运行 setup.py clean,无法构建 shap

标签: python installation shap azureml


【解决方案1】:

我遇到了同样的问题,安装 C++ 版本解决了这个问题。

见下文 How to install Visual C++ Build tools?

【讨论】:

    猜你喜欢
    • 2018-12-16
    • 2016-03-05
    • 1970-01-01
    • 1970-01-01
    • 2023-01-03
    • 2020-04-01
    • 1970-01-01
    • 2020-12-04
    • 2021-11-18
    相关资源
    最近更新 更多