简体   繁体   English

pycocotools - “需要 Microsoft Visual C++ 14.0 或更高版本”虽然已安装

[英]pycocotools - "Microsoft Visual C++ 14.0 or greater is required" although installed

I want to install the TensorFlow object detection API, for that, I need the pycocotools package, which is reliant on Visual Studio C++ Build Tools v14 or higher. I want to install the TensorFlow object detection API, for that, I need the pycocotools package, which is reliant on Visual Studio C++ Build Tools v14 or higher.

I have both tried to install the full Visual Studio 2022, as well as the Visual Studio build tools 2019 separately.我都尝试过分别安装完整的 Visual Studio 2022 以及 Visual Studio 构建工具 2019。 No matter what I do, this is my error message:无论我做什么,这都是我的错误信息:

Building wheel for pycocotools (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\ProgramData\Anaconda3\envs\tensorflow\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\linus\\AppData\\Local\\Temp\\pip-install-qcu6kn44\\pycocotools_48badac11907450f8dc23c6ec17df5de\\setup.py'"'"'; __file__='"'"'C:\\Users\\linus\\AppData\\Local\\Temp\\pip-install-qcu6kn44\\pycocotools_48badac11907450f8dc23c6ec17df5de\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\linus\AppData\Local\Temp\pip-wheel-d2xbzptl'
       cwd: C:\Users\linus\AppData\Local\Temp\pip-install-qcu6kn44\pycocotools_48badac11907450f8dc23c6ec17df5de\
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
  running build_ext
  cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
  C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\linus\AppData\Local\Temp\pip-install-qcu6kn44\pycocotools_48badac11907450f8dc23c6ec17df5de\pycocotools\_mask.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  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: Failed building wheel for pycocotools

I am on a Windows 11 machine with Anaconda3 2021.11 (Python 3.9.7 64-bit) installed.我在安装了 Anaconda3 2021.11(Python 3.9.7 64 位)的 Windows 11 机器上。

My installation details inside Visual Studio installer look like this .我在 Visual Studio 安装程序中的安装详细信息如下所示

Help is much appreciated.非常感谢您的帮助。

I believe you are missing MSBuild.我相信您缺少 MSBuild。 You can add it from visual studio installer.您可以从 Visual Studio 安装程序中添加它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python 错误:需要 Microsoft Visual C++ 14.0,尽管它已经安装 - Python error: Microsoft Visual C++ 14.0 is required, although it has been already installed 需要 Python 3.9 Microsoft Visual C++ 14.0 或更高版本 - Python 3.9 Microsoft Visual C++ 14.0 or greater is required psycopg2:需要 Microsoft Visual C++ 14.0 或更高版本 - psycopg2: Microsoft Visual C++ 14.0 or greater is required pip install web3 - 错误:需要 Microsoft Visual C++ 14.0 或更高版本 - pip install web3 - ERROR: Microsoft Visual C++ 14.0 or greater is required 安装Python包时出现“error: Microsoft Visual C++ 14.0 or greater is required”如何解决? - How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages? pip 安装 web3 | 错误:需要 Microsoft Visual C++ 14.0 或更高版本 - pip install web3 | error: Microsoft Visual C++ 14.0 or greater is required Python package:错误“需要 Microsoft Visual C++ 14.0 或更高版本”和“退出代码 2 失败” - Python package: errors "Microsoft Visual C++ 14.0 or greater is required" & "failed with exit code 2" 错误:安装 pandas-profiling 时需要 Microsoft Visual C++ 14.0 或更高版本 - error: Microsoft Visual C++ 14.0 or greater is required during installation of pandas-profiling Cython:构建扩展时出错:需要 Microsoft Visual C++ 14.0 或更高版本 - Cython: error while building extension: Microsoft Visual C++ 14.0 or greater is required pip install python-pkcs11 错误:需要 Microsoft Visual C++ 14.0 或更高版本 - pip install python-pkcs11 Error: Microsoft Visual C++ 14.0 or greater is required
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM