Python opencv on ubuntu

2023-06-29 linux opencv

The error:

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/abcaadmin/.local/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/abcaadmin/.local/lib/python3.8/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Solution:

sudo apt-get install libgl1

https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo