Skip to content

2. OpenCV

If some library is not working in google colab, try headless

i.e.

!pip install opencv-contrib-python-headless

The headless version of OpenCV, as in opencv-contrib-python-headless, is a variant of OpenCV that does not include any GUI components. This means it lacks functionalities for displaying images or opening GUI windows, which are usually handled by modules like cv2.imshow().

This version is ideal for server environments or cloud platforms where there’s no need for GUI support, as it reduces the package’s size and avoids unnecessary dependencies.