Issue with cv2

File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/", line 333, in _run_script
    exec(code, module.__dict__)

  File "/app/dip_project/", line 5, in <module>
    import cv2

  File "/home/appuser/venv/lib/python3.7/site-packages/cv2/", line 5, in <module>
    from .cv2 import *

ImportError: cannot open shared object file: No such file or directory

Hello @Karthikeya_Tirumalas, welcome to the community!

I’m assuming you’re trying to run the code on Streamlit Sharing? Could you maybe share the link to your repo so we can have a look at the packages you install? Maybe you will need to add additional packages through the packages.txt file at the root of the project with the missing/corrupted dependencies like libglib2.0-0 (more details here about adding Linux packages to the app)

Cheers :balloon: ,

i did pip freeze > requirements.txt
it contains all dependencies

tq for looking into this

now I add that
still No matching distribution found for libglib2.0-0

No matching distribution found for libglib2.0-0

As far as i understand the documentation, you need

  • a requirements.txt file for your pip install dependencies and
  • a packages.txt file for your apt-get install dependencies

in your root folder.

You have mixed the two. It could be that this does not work.

1 Like