安装opencv-python-headless需要很长时间 [英] Install of opencv-python-headless takes a long time

查看:321
本文介绍了安装opencv-python-headless需要很长时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Google Colab中安装 opencv-python-headless 时,需要15分钟才能完成.

When I install opencv-python-headless in Google Colab, it takes 15 minutes to complete.

我的代码:

! pip install --upgrade pip
! pip install opencv-python-headless

这是一个带有此代码的笔记本,它会重新产生问题: https://colab.research.google.com/gist/mherzog01/38b6cf71942a443da072f09bc097387f/slow-install-of-opencv-python-headless.ipynb .

Here's a notebook with this code which recreates the problem: https://colab.research.google.com/gist/mherzog01/38b6cf71942a443da072f09bc097387f/slow-install-of-opencv-python-headless.ipynb.

该过程最终完成,但是我想减少安装时间.

The process eventually completes, but I'd like to reduce the time to install.

我从看到了opencv-python的构建轮(PEP 517)... -`永远运行关于编译OpenCV的讨论,这很可能就是这里发生的事情.但是,同一篇SO帖子指出,如果升级 pip ,它将使用预制的滚轮.

I saw from `Building wheel for opencv-python (PEP 517) ... -` runs forever a discussion about compiling OpenCV, which could very well be what is happening here. However, this same SO post states that if you upgrade pip, it will use pre-built wheels.

编辑:将@intsco的解决方法添加到了Google Colab

Added @intsco's workaround to the Google Colab

推荐答案

可能与OpenCV> = 4.3转轮中的更改有关 https://github.com/skvark/opencv-python#backward-compatibility

Might be related to changes in OpenCV >=4.3 wheels https://github.com/skvark/opencv-python#backward-compatibility

从4.3.0和3.4.10开始构建,将Linux构建环境从manylinux1更新为manylinux2014.这放弃了对旧Linux发行版的支持.

Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from manylinux1 to manylinux2014. This dropped support for old Linux distributions.

我的解决方法: pip install"opencv-python-headless <4.3"

这篇关于安装opencv-python-headless需要很长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆