windows 安装pycocotools:ERROR: Could not build wheels for pycocotools, which is required to install py

问题描述:pycocotools是什么?即python api tools of COCO。
但是使用pip install 时经常会有异常,但是安装失败

pip安装方法:

pip install pycocotools==2.0.0

or

pip install pycocotools-windows

但是,我经常会安装不成功,报以下错误:大概就是我缺一些依赖(windows OS下)

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

使用以下命令安装:

pip install pycocotools-windows -i https://pypi.tuna.tsinghua.edu.cn/simple

但是安装其他包时依赖还是无法解决

error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com

解决方案:
可以直接安装Microsoft C++ Build Tools,而不需要安装Visual Studio。

我们也可以去官网下载对应的文件(需要拥有一个微软的账号)

链接 Home – Visual Studio Subscriptions Portal,登录账号,点击进入下载页面

在这里插入图片描述
接下来,在下载页面搜索build tools,点击搜索之后找到左侧的Visual Studio 2015 update 3。

在这里插入图片描述

点击Visual Studio 2015 update 3后,下载对应的文件即可,这里需要将格式修改为DVD。
在这里插入图片描述

之后安装就可以了。

reference:https://zhuanlan.zhihu.com/p/471661231

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
扎眼的阳光的头像扎眼的阳光普通用户
上一篇 2023年3月6日 上午9:48
下一篇 2023年3月6日

相关推荐