【问题标题】:Could not install pycocotools in windows10无法在 windows10 中安装 pycocotools
【发布时间】:2022-01-16 01:49:11
【问题描述】:

我正在尝试通过此链接安装 cocoapi:https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html

我按照给定的说明进行操作,但遇到下面显示的错误,我尝试了很多解决方案,但没有任何效果。任何帮助将不胜感激。

我尝试了以下命令:

$ pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
$ pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"

但是对于这两个命令,我得到以下错误:

ERROR: Command errored out with exit status 1:
     command: 'C:\Users\LENOVO\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-ohatcfil\\pycocotools_6b8d44b0841d4434ab4a95deb55f7d9a\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-ohatcfil\\pycocotools_6b8d44b0841d4434ab4a95deb55f7d9a\\PythonAPI\\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\LENOVO\AppData\Local\Temp\pip-record-4ngej82s\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\LENOVO\anaconda3\Include\pycocotools'
         cwd: C:\Users\LENOVO\AppData\Local\Temp\pip-install-ohatcfil\pycocotools_6b8d44b0841d4434ab4a95deb55f7d9a\PythonAPI
    Complete output (6 lines):
    running install
    running build
    running build_py
    running build_ext
    building 'pycocotools._mask' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\LENOVO\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-ohatcfil\\pycocotools_6b8d44b0841d4434ab4a95deb55f7d9a\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-ohatcfil\\pycocotools_6b8d44b0841d4434ab4a95deb55f7d9a\\PythonAPI\\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\LENOVO\AppData\Local\Temp\pip-record-4ngej82s\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\LENOVO\anaconda3\Include\pycocotools' Check the logs for full command output.

【问题讨论】:

    标签: python tensorflow


    【解决方案1】:

    正如错误所说,为了在 Windows 系统上构建 pycocotools,您需要安装额外的 C++ 可再发行组件。

    需要 Microsoft Visual C++ 14.0 或更高版本。使用“Microsoft C++ Build Tools”获取它:https://visualstudio.microsoft.com/visual-cpp-build-tools/

    【讨论】:

    • 我从上面的链接安装了Microsoft Visual C++ 14.0,问题解决了非常感谢您的支持。
    【解决方案2】:

    我从“https://visualstudio.microsoft.com/visual-cpp-build-tools/”这个链接安装了 Microsoft Visual C++ 14.0,问题就解决了

    感谢 Skully 的支持。

    【讨论】:

      猜你喜欢
      • 2019-06-06
      • 1970-01-01
      • 1970-01-01
      • 2016-08-18
      • 2021-08-28
      • 1970-01-01
      • 2020-08-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多