當(dāng)出現(xiàn)此錯(cuò)誤時(shí),一般通過(guò)直接搜索該錯(cuò)誤,其他指南給出的解決辦法不一定適用于自己的情況。需要根據(jù)報(bào)錯(cuò)內(nèi)容中具體的error找到解決方案。
個(gè)人報(bào)錯(cuò)情況如下
Building wheels for collected packages: 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
╰─> [16 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-cpython-38\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-cpython-38\pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
building 'pycocotools._mask' extension
C:\Users\hp\AppData\Local\Temp\pip-build-env-jupdccjk\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\hp\AppData\Local\Temp\pip-install-d99qvim5\pycocotools_fb88fac654854a0e97575930567f7c48\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[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
?根本錯(cuò)誤在于Microsoft Visual C++ 14.0 or greater is required.
解決方法
重新安裝c++的各個(gè)版本沒有用,即便我的電腦上有了最新版還是會(huì)報(bào)錯(cuò)。
所以最終安裝了visual studio c++的生成工具(不用安裝全部的vs c++)。
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-535291.html
?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-535291.html
到了這里,關(guān)于Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!