首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pycocotools“需要Microsoft Visual C++ 14.0或更高版本”,尽管已安装

pycocotools“需要Microsoft Visual C++ 14.0或更高版本”,尽管已安装
EN

Stack Overflow用户
提问于 2021-11-20 09:04:19
回答 1查看 258关注 0票数 0

我想安装TensorFlow对象检测API,为此,我需要pycocotools包,它依赖于Visual Studio C++ Build Tools v14或更高版本。

我已经分别尝试安装了完整的Visual Studio 2022和Visual Studio build tools 2019。无论我做什么,这都是我的错误消息:

代码语言:javascript
复制
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

我在一台安装了Anaconda3 2021.11 (Python3.9.7 64位)的Windows11机器上。

我在Visual Studio installer中的安装细节看起来像this

非常感谢您的帮助。

EN

回答 1

Stack Overflow用户

发布于 2021-11-22 07:01:43

我相信你会错过MSBuild的。您可以从visual studio安装程序中添加它。

我安装的是Herepycocotools安装得很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70044565

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档