下载安装requirements.txt报错:
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 ╰─> [16 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\Administrator\AppData\Local\Temp\pip-build-env-elbsgpdq\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\Administrator\AppData\Local\Temp\pip-install-56xbtqxd\pycocotools_84d7a8206f034bfba5c29314bb1b4d84\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": Microsoft C++ Build Tools - Visual Studio [end of output]
方案:
根本错误在于Microsoft Visual C++ 14.0 or greater is required.
解决方法 ,重新安装visual studio c++的生成工具(不用安装全部的vs c++)。
链接: Microsoft C++ Build Tools - Visual Studio
再重新安装requirements.txt,
pip install -r requirements.txt
完美解决
之后训练自己的模型可以参考这位大佬:
目标检测---教你利用yolov5训练自己的目标检测模型_yolov5如何训练自己的模型_炮哥带你学的博客-CSDN博客