Getting No module cv2 found

Hi All,

I been trying to deploy an app using streamlit. but getting cv2 module not found.

pls can anyone help me to sort out this issue

image

That’s because there is not PyPI module with the name “cv2”, I would say. So for example, pip install cv2 will also fail in your local Python environment. How did you install the package in your local environment?

I guess what you want is opencv-python · PyPI, at least in their readme they use it with import cv2. So you should add opencv-python to your requirements.txt.

I used pip install opencv-python command to install open cv package in local machine. And in requirement.txt file i have added opencv-python-headless==4.5.1.48 as a requirement. still getting the error.
pls let me know what changes i have to do.
Thanks

I would say one needs to take a look at the full log file then. Your log in the screenshot is cropped to the right and to the top, so it’s hard to say if opencv-python-headless==4.5.1.48 is installed correctly.

Hi @Arun_A.S,

Welcome to the Streamlit forum! :wave: :smile:

For future reference, please read through our guidelines on asking an effective question and share relevant links to your app and GitHub repo.

It looks like you’ve misspelled your dependency file as requirement.txt. Once you rename the file in GitHub to requirements.txt, all the required dependencies should get installed.

Best,
Snehan :balloon:

Thanks @snehankekre. My bad, yes spell error created all the problem

Thanks @jgieseler . Issue sorted out

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