Error : File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script exec(code, module.__dict__) File "/mount/src/ctscanvideo/new15.py", line 2, in <module> import cv2

i have error that opencv not work why?

!pip install streamlit tensorflow pillow

!pip install beautifulsoup4 requests nltk

!pip install opencv-python

!pip install opencv-contrib-python

!pip install opencv-python-headless

!pip install opencv-contrib-python-headless

%%writefile app.py

import os

import cv2

import numpy as np

import streamlit as st

from PIL import Image

from tensorflow.keras.models import load_model

the above is my installations

You can try re-installing the opencv package. It’s best to use python virtual env when installing other libraries as it may cause issues with the existing ones.
Also, your query isn’t related to Streamlit but to the Python setup. You can read more here .

Looks like you forgot to install opencv in streamlit cloud.

You need a requirements.txt file for the deployment.
Search for opencv keyword here, there are dozens of threads…