CV2 - ImportError: libGL.so.1

Python Version: 3.11
Streamlit Version: last
GitHub repository: GitHub - Matsharik/eco

Hi! If I open this page, the error occurs:

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/eco/pages/Найти_мусор_на_фото.py", line 2, in <module>

    import Scam.PhotoCheck
  File "/mount/src/eco/Scam/PhotoCheck.py", line 1, in <module>
    import cv2
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

........................

I've tried writing opencv-python-headless instead of opencv-python, but it hasn't helped.

Could you help me, please?

____________
requirements.txt:

streamlit
opencv-python-headless
imageai
pillow
av

Hi @MTSH

This seems to be a library dependency issue, can you see the Stackoverflow link below for several solutions that you can try by installing library dependencies

The problem is caused by the imageai library, which in turn forces the dependency on opencv-python>=4.1.2


If you have to use this library, this should fix the error:

packages.txt

libgl1
libglib2.0-0

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.