Error in deploying cv2 app

Hello guys, I am trying to deploy my cv2 app using streamlit but i keep getting this error

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/photo-editor-with-opencv/editor_main.py", line 1, in <module>
    import cv2
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

This is the link to my repo: GitHub - ChibuikeOnuba/Photo-editor-with-openCV
how do i fix this please

1 Like

Hi @FrAmeS,

Thanks for posting!

Create a packages.txt file in your repo with the following line to install the apt-get dependency libgl:

libgl1
1 Like

Alternatively, change in the requirements.txt file:
opencv-python-headless instead of opencv-python

2 Likes

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