ImportError: libGL.so.1: cannot open shared object file: No such file or directory

I am trying to run cv2, but when I try to import it, I get the following error:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

The suggested solution online is installing

apt install libgl1-mesa-glx

but this is already installed and the latest version.

NB: I am actually running this on Docker, and I am not able to check the OpenCV version. I tried importing matplotlib and that imports fine.

14 Answers
14

Leave a Comment