ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly

  ERROR: Command errored out with exit status 1:
   command: 'D:\anaconda\envs\pytorch\python.exe' 'D:\anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C
:\Users\gh\AppData\Local\Temp\tmpsnf99kcw'
       cwd: C:\Users\gh\AppData\Local\Temp\pip-install-zkgqouc1\pycocotools_3e69cc3b3d354c72b8354acb329c21d0
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools
  running build_ext
  skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
  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-to
ols/
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly

yolov5配置环境无法安装pycocotools。
在https://visualstudio.microsoft.com/visual-cpp-build-tools/下载。第一步:选c++。第二步:在单个组件内输入build查找,勾选适用于v142的C++ Clang-cl生成工具(x64/x86)。Visual Studio 生成工具 2019,下载并安装。

你可能感兴趣的:(python)