Opencv module not found

kindly uninstall cv2

pip uninstall opencv-python

Install the package afresh

pip install opencv-python

Hope that works!

in
----> 1 import cv2

~\Lib\site-packages\cv2_init_.py in
3 import sys
4
----> 5 from .cv2 import *
6 from .data import *
7

ModuleNotFoundError: No module named ‘cv2.cv2’

try this ,
in your jupyter notebook cell , use command
!pip install opencv-python

its working now but output is not showing
img = cv2.imread(‘C:\Users\SHIVANSHU\Desktop\logo1.png’)
gray = cv2.imread(‘C:\Users\SHIVANSHU\Desktop\logo1.png’,cv2.IMREAD_GRAYSCALE)

cv2.imshow(‘image’,img)
cv2.imshow(‘gray’,gray)

try printing img and gray , do they contain any value?

No output is shown again

kindly check the path to image is valid and exists in our system.

path is C:\Users\SHIVANSHU\Desktop
name is: logo1.png

see if printing cv2.imread gives output as None , then you have some problem in image.
So i would suggest you kindly with another image in same folder or another folder.

Thank you sir its working now

no problem.
Kindly mark this doubt as resolved and also do provide your valuable feedback .

Thank You and Happy Learning :slightly_smiling_face:.