安装pycocotools模块报错:Microsoft Visual C++ 14.0 or greater is required

安装pycocotools模块,出现报错:

building 'bitarray._bitarray' extension       
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]

在这里插入图片描述
报错原因:编译pycocotools模块中出现编译错误,需要安装C++的编译
解决办法:安装确实的C++编译依赖

安装Microsoft Visual C++ 14.0对应的包:
选择依赖进行安排:
在这里插入图片描述

点击修改或者安装
在这里插入图片描述
可以全部安装,不过其实没有必要,因为很多是为了进行C++的代码编译而写的项目模块,对于仅仅是消除bug,其实用处不大,仅需要安装我在打钩的两个部分即可。

重新执行pycocotools的安装模块指令:

pip install pycocotools -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

这里我使用阿里源的镜像,提高安装的速度。

在这里插入图片描述
以上可以安装成功,bug修复。


版权声明:本文为baidu_39629638原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。