2

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

2 Answers2

2

use this from sagars answer from here

sudo apt update
sudo apt install libgl1-mesa-glx
ls_da3m0ns
  • 146
  • 5
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