I am having this error

The code I have used is:

import cv2
from matplotlib import pyplot as plt
img = cv2.imread(‘sagnik.jpg’)
plt.imshow(img)

This is the image

Also add the following statement before plt.imshow:

import numpy as np
img = np.array(img)

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.