I have run pip install opencv-python
however when I do import cv2
I get this error ImportError: libGL.so.1: cannot open shared object file: No such file or directory
. I tried the steps described here too https://docs.opencv.org/4.4.0/d2/de6/tutorial_py_setup_in_ubuntu.html
Asked
Active
Viewed 3,502 times
2

Bassem Yacoube
- 21
- 1
- 5
2 Answers
2
use this from sagars answer from here
sudo apt update
sudo apt install libgl1-mesa-glx

ls_da3m0ns
- 146
- 5
-
1How will this work if you don't have root access to the host where **Jupyter** runs on? – Konstantin A. Magg Oct 13 '21 at 19:20
-
!pip install opencv-python-headless instead of !pip install opencv-python should do the trick – Norod78 Dec 09 '21 at 07:37
0
If your environment does not allow you to sudo, you can instead of the standard opencv-python package, get the headless version of it
!pip install opencv-python-headless
which brings its binaries with it

Norod78
- 693
- 1
- 6
- 6