If you’re having issues installing OpenCV on a Gradient notebook, you may try the following steps:
Open a Terminal within the Jupyter Notebook.
Then, install the dependency that’s missing running
apt install libgl1-mesa-glx
Last, install OpenCV with
pip install opencv-python
Once you’ve installed all of the packages, stop the kernel and start it again. Otherwise, stop the notebook completely and run it another time. All of these commands must be run from within a Terminal on the Notebook.
To test that OpenCV has been installed, please run:
import cv2 cv2.__version__