Display usb camera on jupyter

Hello, i try to connect my usb camera to the jetbot but i dont succeed.
I would like to see the display on jupyter exactly like i see it on the linux jetbot user itself.
i run this simple code (i added in the end) that works perfectly on my main usr (jetbot)
when i try to run it via root (jupyter) i get this warning:
gtk-WARNING ** 15:29:17.674: cannot open display
and the camera lamp itself is on ON for 1 sec and then OFF.

This is my code:- works good on jetbot, doesnt work on jupyter
ill be happy if you can help me to get it to work on jupyter
thanks a lot, yoni

#code for activating usb camera
import cv2

dispWusb=640#res x usb cam
dispHusb=480#res y usb cam
cam=cv2.VideoCapture(1)# 0=>go to the first camera
cam.set(3,dispWusb)
cam.set(4,dispHusb)
while True:
ret, frame=cam.read()
cv2.imshow(‘piCam’,frame)
cv2.moveWindow(‘piCam’,0,0)
if cv2.waitKey(1)==ord(‘q’):# 1ms for see if key is pressed and if its q
break

cam.release()
cv2.destroyAllWindows

Hi,
Probably you don’t set DISPLAY environment variable:

$ export DISPLAY=:0(or 1)

If it does not work after setting it, please follow the steps to check if the USB camera can be launched in gstreamer pipeline:
Jetson Nano FAQ
Q: I have a USB camera. How can I launch it on Jetson Nano?

hi, sorry for the delay.
its not work for me, i tried your both suggestions.
i checked some in the internet and found that cv crash jupyter somehow.
but still didnt find solution so i think ill leave the jupyter for my work.
i just need to find a way to connect remotely to the nano and present the camera in order to make the jetbot connected wireless way and show the camera the robot “see” from remote pc.

if you know a way to do it, it will be good for me. or if know way to activate usb camera there, it will be nice solution for me too.
thanks a lot