When I install opencv-python-headless
in Google Colab, it takes 15 minutes to complete.
My code:
! pip install --upgrade pip
! pip install opencv-python-headless
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.
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.
Edit: Added @intsco's workaround to the Google Colab