Pycocotools 报error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Bui

Pycocotools 报error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Bui,第1张

Pycocotools

很多深度学习项目会用到Pycocotools

一般直接在conda环境下运行

pip install pycocotools

在Windows下直接运行该命令可能出现如下报错提示

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"

提示需要 Microsoft Visual C++ 14.0

下面给出三种解决方案

✨解决方案一
pip install pycocotools -i https://mirrors.aliyun.com/pypi/simple/

发现用阿里的镜像源安装不会出现报错 可以正常安装

✨解决方案二

安装 Visual C++ 2015 build tools

点击以下链接

GitHub - philferriere/cocoapi: Clone of COCO API - Dataset @ http://cocodataset.org/ - with changes to support Windows build and python3

点击 “here” 下载

或者直接点击 Visual C++ 2015 build tools 下载链接

点击安装

(有可能失败 网络原因或者提示安装包丢失或者损坏)

笔者在一台电脑上安装成功了 另一台电脑就安装失败了= =

如果安装成功后再运行

pip install pycocotools

Pycocotools安装成功

✨解决方案三

安装 Visual Studio 2019 以下内容

  • 工作负载:使用C++的桌面开发
  • 安装组件:适用于v142 的 C++ Clang-cl 生成工具(x64/x86)

!注意:适用于v142 的 C++ Clang-cl 生成工具(x64/x86) 组件必须安装

下载 Visual Studio 2019 安装程序

下载 Windows 版和 Mac 版 Visual Studio 2019 (microsoft.com)

在 “单个组件” 中搜索 build

勾选 “适用于v142 的 C++ Clang-cl 生成工具(x64/x86)”

安装成功后再运行

pip install pycocotools

Pycocotools安装成功

✨参考及引用

Pycocotools安装_coder_zrx的博客-CSDN博客_pycocotools安装

目标检测 YOLOv5 开源代码项目调试与讲解实战【土堆 x 布尔艺数】_哔哩哔哩_bilibili

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/869268.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存