Home>

python3.7.4

python super beginner.
Thank you in advance.

In interactive mode
Program code

img1 = cv2.imread ("lena.jpg", 0)


When I run, I get the following error:

>>>img1 = cv2.imread ("lena.jpg", 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in<module>
NameError: name 'cv2' is not defined


How can I get rid of this error?

Add

import cv2
When

is executed,

>>>import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in<module>
ModuleNotFoundError: No module named 'cv2'

and a new error appeared.