0

嗨,我无法安装 pycocotools

pip install pycocotools

在 jupyter notebook 和 venv 上!为了修复此错误,我尝试将 Visual Studio 工具 2017 更新到 2019,但未修复!我尝试安装 Cython,但仍然有同样的错误:

    Collecting pycocotools
  error: subprocess-exited-with-error
  
  Building wheel for pycocotools (pyproject.toml) did not run successfully.
  exit code: 1
  
  [9 lines of output]
  running bdist_wheel
  running build
  running build_py
  running build_ext
  skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
  building 'pycocotools._mask' extension
  maskApi.c
  ./common/maskApi.c(8): fatal error C1083: Cannot open include file: 'math.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects

  Using cached pycocotools-2.0.4.tar.gz (106 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: numpy in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from pycocotools) (1.22.2)
Requirement already satisfied: matplotlib>=2.1.0 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from pycocotools) (3.5.1)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (4.29.1)
Requirement already satisfied: packaging>=20.0 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (21.3)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (3.0.7)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.8.2)
Requirement already satisfied: cycler>=0.10 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (1.3.2)
Requirement already satisfied: pillow>=6.2.0 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (9.0.1)
Requirement already satisfied: six>=1.5 in c:\users\christ\desktop\obj det\tfod\lib\site-packages (from python-dateutil>=2.7->matplotlib>=2.1.0->pycocotools) (1.16.0)
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (pyproject.toml): started
  Building wheel for pycocotools (pyproject.toml): finished with status 'error'
Failed to build pycocotools

在相同的主题中,错误与我的安装错误不同,所以请帮助我

tnx

4

0 回答 0