Guide: How to install OpenCV on a Gradient notebook

If you’re having issues installing OpenCV on a Gradient notebook, you may try the following steps:

  • Open a Terminal within the Jupyter Notebook.

  • Run apt-get update

  • Run apt-get upgrade

  • 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
1 Like

Thanks for this

How do I open the terminal?

Hey Oliver, currently the Terminal can be accessed using the Jupyter interface. We’re working to add a Terminal option to the Gradient IDE very soon!