Can't import cv2


ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import cv2

ModuleNotFoundError: No module named ‘cv2’

I am facing the above mentioned error.
I have tried it many times but it’s not working.
I have installed opencv-python

Hey @mananaroramail, you need to install opencv, open jupyter notebook and install it using this command,

!pip install opencv-python

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

What’s a directory?
Where should I store the image to load them using imread()
What I did was
Import cv
Img=cv2.imread(‘images/Balbasaur.jpg’)
And my current python file and the image are in the same folder images.
But still the output is not coming

Hey @mananaroramail, use Img=cv2.imread(‘./images/Balbasaur.jpg’)

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

It took me the whole day to search for this “./” as Sir didn’t mention in the video. :smile:
By the way thanks.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.