【问题标题】:Building wheel for opencv-python keeps running for a very long timeopencv-python 的构建轮保持运行很长时间
【发布时间】:2023-01-16 02:47:35
【问题描述】:

opencv-python 的构建轮在构建 docker 映像时保持运行很长时间。可以做些什么来使它运行得更快?

运行 pip 安装 opencv-python

Collecting opencv-python
  Downloading opencv-python-4.6.0.66.tar.gz (90.3 MB)

...

  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: opencv-python, numpy
  Building wheel for opencv-python (pyproject.toml): started
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...   
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...
  Building wheel for opencv-python (pyproject.toml): still running...

【问题讨论】:

  • 你等了多少分钟?
  • @YunusTemurlenk 大约需要 30-45 分钟,我们还在 Dockerfile 中升级了 pip
  • OpenCV 很大。有一些耐心。并且不要在资源受限的设备(如覆盆子)上运行它,或者如果你这样做,预计它需要一段时间。 -- 你为什么需要建造?官方的 opencv-python 包是二进制的,适用于许多架构。
  • @ChristophRackwitz 这是在 t2.large 机器上,它仍然很慢

标签: python-3.x opencv


【解决方案1】:

我在低级机器上也遇到过同样的问题。实际上需要很长时间,但后端没有任何问题。使用--verbose 运行安装命令,这样您就可以看到背后实际发生了什么。

当我运行代码时:

sudo pip install opencv-python --verbose

我能够跟踪过程并检查安装百分比。所以 30 分钟后,它仍然完成了 30% - :) 一台非常低的机器,但我们有时需要安装它 - 经过一点耐心,2 小时后就完成了,所以无论谁遇到这个错误,这都可能对他们有所帮助。

【讨论】:

    猜你喜欢
    • 2013-06-11
    • 2020-12-19
    • 2021-11-17
    • 1970-01-01
    • 2021-07-20
    • 2017-04-16
    • 2018-12-22
    • 2021-02-15
    • 2011-03-16
    相关资源
    最近更新 更多