在anaconda3下创建的虚拟环境安装yolov7,python=3.9
pip安装pycocotools时出现报错
Building wheel for pycocotools (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pycocotools (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-cpython-39\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-cpython-39\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-cpython-39\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-cpython-39\pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
C:\Users\abc123\AppData\Local\Temp\pip-build-env-0_0h_7_r\overlay\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\abc123\AppData\Local\Temp\pip-install-n7meyadh\pycocotools_6d0acd7d55ac424ab518dbc1e73d52ba\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools._mask' extension
creating build\temp.win-amd64-cpython-39
creating build\temp.win-amd64-cpython-39\Release
creating build\temp.win-amd64-cpython-39\Release\common
creating build\temp.win-amd64-cpython-39\Release\pycocotools
"D:\Microsoft Visual\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\abc123\AppData\Local\Temp\pip-build-env-0_0h_7_r\overlay\Lib\site-packages\numpy\core\include -I./common -ID:\Anaconda3\envs\opencv__env1\include -ID:\Anaconda3\envs\opencv__env1\Include "-ID:\Microsoft Visual\VC\Tools\MSVC\14.33.31629\include" "-ID:\Microsoft Visual\VC\Auxiliary\VS\include" /Tc./common/maskApi.c /Fobuild\temp.win-amd64-cpython-39\Release\./common/maskApi.obj
maskApi.c
./common/maskApi.c(8): fatal error C1083: 无法打开包括文件: “math.h”: No such file or directory
error: command 'D:\\Microsoft Visual\\VC\\Tools\\MSVC\\14.33.31629\\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
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects
希望得到指点