栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

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

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/853920.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号