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

操作系统:ubuntu18.04.6

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

pip install pycocotools

在安装过程中,我遇到了两个问题:

[En]

During the installation, I encountered two problems:

  1. 安装速度慢

  2. 遇到了报错

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

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

鉴于下载速度较慢,可以使用国产镜像进行下载。我一般都习惯用清华的形象来参选。

[En]

In view of the slow download speed, we can use the domestic image to download. I am generally used to using the Tsinghua image to run.

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

你可以使用清华镜像下载,下载速度瞬间快得多。

[En]

You can use Tsinghua image to download, and the download speed is much faster in an instant.

针对报错

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

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

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

首先更新程序包列表并运行

[En]

First update the package list and run

sudo apt update

之后安装build-essential软件包

sudo apt install build-essential

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

一般来说,这一点是可以解决的,但我也遇到了

[En]

Generally speaking, it can be solved at this point, but I also encountered

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/7708/

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

(0)

大家都在看

最近整理资源【免费获取】:   👉 程序员最新必读书单  | 👏 互联网各方向面试题下载 | ✌️计算机核心资源汇总