[英]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.