Problem import cv2

REPO = GitHub - angelicaba23/app-super-resolution

2022-03-24 00:13:50.381 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.8/site-packages/streamlit/script_runner.py", line 430, in _run_script
    exec(code, module.__dict__)
  File "/app/app-super-resolution/app.py", line 3, in <module>
    from face_dectec import faceDetection
  File "/app/app-super-resolution/face_dectec.py", line 1, in <module>
    import cv2
  File "/home/appuser/venv/lib/python3.8/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
2022-03-24 00:21:51.054 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.8/site-packages/streamlit/script_runner.py", line 430, in _run_script
    exec(code, module.__dict__)
  File "/app/app-super-resolution/app.py", line 3, in <module>
    from face_dectec import faceDetection
  File "/app/app-super-resolution/face_dectec.py", line 1, in <module>
    import cv2
  File "/home/appuser/venv/lib/python3.8/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Replace opencv_python in your requirements.txt file with:

opencv-python-headless

Hi, thanks!

Now I get this. …

Your are not using the latest version of face_detection. Leave away the version in your requirements.txt file or use the latest version.

face-detection · PyPI

Receiving HTTP 308 error while creating detector · Issue #21 · hukkelas/DSFD-Pytorch-Inference · GitHub

2 Likes

Omg thanks!! you saved my life :smiling_face_with_three_hearts:.

1 Like

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