m0_73501033 2022-10-18 11:23 采纳率: 50%
浏览 611
已结题

pycocotools安装报错

在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

希望得到指点

  • 写回答

2条回答 默认 最新

  • Elwin Wong 2022-10-18 11:31
    关注

    我也遇到过同样的错误,你可以看看,记录在这里:https://blog.csdn.net/zhaoyuanh/article/details/127247879

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 10月26日
  • 已采纳回答 10月18日
  • 创建了问题 10月18日

悬赏问题

  • ¥50 关于#html5#的问题:H5页面用户手机返回的时候跳转到指定页面例如(语言-javascript)
  • ¥15 无法使用此凭据登录,因为你的域不可用,如何解决?(标签-Windows)
  • ¥15 yolov9的训练时间
  • ¥15 二叉树遍历没有报错但无法正常运行
  • ¥15 在linux系统下vscode运行robocup3d上场球员报错
  • ¥15 Python语言实验
  • ¥15 SAP HANA SQL 增加合计行
  • ¥20 用C#语言解决一个英文打字练习器,有偿
  • ¥15 srs-sip外部服务 webrtc支持H265格式
  • ¥15 在使用abaqus软件中,继承到assembly里的surfaces怎么使用python批量调动