Reputation: 21
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
Upvotes: 2
Views: 4419
Reputation: 723
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
Upvotes: 2
Reputation: 146
use this from sagars answer from here
sudo apt update
sudo apt install libgl1-mesa-glx
Upvotes: 2