安装pycocotools时遇到ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be instal

操作系统:ubuntu18.04.6

最近在安装MMdetection3d时,其中一步需要安装pycocotools,但是直接采用

pip install pycocotools

进行安装时,我遇到了两个问题:

  1. 安装速度慢

  2. 遇到了报错

ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed

安装pycocotools困扰了3个整天的时间,因此我整理了博客,希望能够帮助到大家,也作为我以后需要的话,可以快捷地找到解决方法,

针对下载速度慢的问题,我们可以采用国内镜像进行下载,我一般习惯于采用清华镜像,运行

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

即可采用清华镜像进行下载,下载速度瞬间快了很多~

针对报错

ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed

这一问题,网上搜了很多方法都没有解决我的问题,最后我发现,安装gcc和g++可以解决这一问题。因为我是新配置的虚拟机,所以没有gcc和g++,而pycocotools的安装需要基于gcc和g++才可以运行

解决方法:安装gcc和g++

首先更新包列表,运行

sudo apt update

之后安装build-essential软件包

sudo apt install build-essential

该命令将安装包括gcc,g ++在内的一些包

一般来说,到这一步就可以解决了,但是我还遇到了

Ubantu18.04.6:依赖: g++-7 (>= 7.4.0-1~) 但是它将不会被安装

Original: https://blog.csdn.net/weixin_57096837/article/details/122775990
Author: 和自己对话的兔子
Title: 安装pycocotools时遇到ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be instal

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/706139/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球