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.
pip install opencv-python
? Could be another issue. See github.com/matplotlib/matplotlib/issues/9954. Try creating a virtualenv and test it there. Can you share your code snippet where its throwing the exception?apt install libgl1-mesa-glx
helped me.apt install libgl1-mesa-glx
" The title is misleading if you are NOT using docker. EDIT: I have done this for you.