libGl.so.1 error while importing opencv-python

hello guys, I’ve got error while importing and using opencv-python package

error:

Traceback (most recent call last):
  File "/home/runner/convert-image-to-grayscale/main.py", line 2, in <module>
    import cv2
  File "/home/runner/convert-image-to-grayscale/.pythonlibs/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/runner/convert-image-to-grayscale/.pythonlibs/lib/python3.10/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/importlib/__init__.py", line 126, 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

Hi @IqbalAhmadi , welcome to the forums!
Could you try this repl suggested here?

2 Likes