解决:Could not build wheels for pycocotools, which is required to install pyproject.toml-based

 发现问题:

1.

我在安装 pycocotools 时,出现错误:“ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects” 

2.(若有此问题,则需安装C++工具)

而且仔细查看错误后:会有“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/

解决问题:

使用命令:

pip install pycocotools -i https://pypi.python.org/simple

如果此时能安装成功,那么恭喜。

如果依旧出现上述第二个error:点击以下链接下载工具:https://visualstudio.microsoft.com/visual-cpp-build-tools

 解决:Could not build wheels for pycocotools, which is required to install pyproject.toml-based_第1张图片

打开进行安装,选择以下工具包,等待安装完即可:

解决:Could not build wheels for pycocotools, which is required to install pyproject.toml-based_第2张图片

pip成功:

 

分析问题:

使用了国内源进行安装,导致安装包的一些依赖无法下载,所以切换回国外源就行了。

至于第二个问题,存粹是电脑更新速度太快,很多包没有自动更新

 

 

你可能感兴趣的:(BUG,microsoft,python)