Bassem Yacoube
Bassem Yacoube

Reputation: 21

import cv2 in Sagemaker Studio jupyter notebook throws ImportError: libGL.so.1: cannot open shared object file: No such file or directory

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

Answers (2)

Norod78
Norod78

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

ls_da3m0ns
ls_da3m0ns

Reputation: 146

use this from sagars answer from here

sudo apt update
sudo apt install libgl1-mesa-glx

Upvotes: 2

Related Questions