【深度学习】Windows安装Pycocotools(Microsoft Visual C++ 14.0 or greater is required.报错提示解决方案)

✨Pycocotools

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

一般直接在conda环境下运行

pip install pycocotools

或者使用阿里镜像源安装

pip install pycocotools -i https://mirrors.aliyun.com/pypi/simple/

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

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

提示需要 Microsoft Visual C++ 14.0


下面给出两种解决方案


✨解决方案一

安装 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安装成功


✨参考及引用

https://blog.csdn.net/qq_37705280/article/details/111053515

https://www.bilibili.com/video/BV1tf4y1t7ru?p=2


⭐转载请注明出处

本文作者:双份浓缩馥芮白

原文链接:https://www.cnblogs.com/Flat-White/p/15123308.html

版权所有,如需转载请注明出处。

原文地址:https://www.cnblogs.com/Flat-White/p/15123308.html