opencv-python的Building wheel会持续运行很长时间

w46czmvw  于 2023-01-17  发布在  Python
关注(0)|答案(1)|浏览(1787)

为opencv-python构建wheel会持续运行很长时间,同时构建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...
mccptt67

mccptt671#

我在一个底层机器上也遇到过同样的问题,实际上需要很长时间,但是后端没有问题,用--verbose运行安装命令,这样你就可以看到后面到底发生了什么。
当我运行代码时:

sudo pip install opencv-python --verbose

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

相关问题