Name 'cv2' is not defined

Hello,
I am doing a code in python using OpenCV but i am facing with an error. I am looking forward if someone is helping me.
I have installed OpenCV. When I use Import cv2 everything is okay. But later when I want to use it in cv2.VideoCapture this error is shown.
name ‘cv2’ is not defined
image

you have to either

import cv2

in the current cell,
or run another cell importing it before.

i have done it

just make sure to run cell [1] before anything else (order matters !)

(and any time the runtime restarts, you have to run it again)

thank you very much. it is okay now

1 Like