Hello camera Jetson Nano jetcam not working in Jupyter

I’m running nvcr.io/nvidia/l4t-ml:r36.2.0-py3 like this:

docker run -it --rm --device /dev/video0 --net=host --runtime nvidia nvcr.io/nvidia/l4t-ml:r36.2.0-py3

and I’m trying to observe the camera, using jetcam in a notebook:

from jetcam.csi_camera import CSICamera
camera = CSICamera(width=224, height=224, capture_width=1080, capture_height=720, capture_fps=30)

but I get:


ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from jetcam.csi_camera import CSICamera
3 camera = CSICamera(width=224, height=224)

ModuleNotFoundError: No module named ‘jetcam’

if I install jetcam in the container:

git clone GitHub - NVIDIA-AI-IOT/jetcam: Easy to use Python camera interface for NVIDIA Jetson
cd jetcam
python3 setup.py install

then I get


ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from jetcam.csi_camera import CSICamera
3 camera = CSICamera(width=224, height=224)

File /usr/local/lib/python3.10/dist-packages/jetcam-0.0.0-py3.10.egg/jetcam/csi_camera.py:3
1 from .camera import Camera
2 import atexit
----> 3 import cv2
4 import numpy as np
5 import threading

File /usr/local/lib/python3.10/dist-packages/cv2/init.py:181
176 if DEBUG: print(“Extra Python code for”, submodule, “is loaded”)
178 if DEBUG: print(‘OpenCV loader: DONE’)
→ 181 bootstrap()

File /usr/local/lib/python3.10/dist-packages/cv2/init.py:153, in bootstrap()
149 if DEBUG: print(“Relink everything from native cv2 module to cv2 package”)
151 py_module = sys.modules.pop(“cv2”)
→ 153 native_module = importlib.import_module(“cv2”)
155 sys.modules[“cv2”] = py_module
156 setattr(py_module, “_native”, native_module)

File /usr/lib/python3.10/importlib/init.py:126, in import_module(name, package)
124 break
125 level += 1
→ 126 return _bootstrap._gcd_import(name[level:], package, level)

ImportError: libnvrm.so: cannot open shared object file: No such file or directory

how do I solve this? or if there is a better way to read the camera, what is it?

Hi,
The jetcam sample is only for Jetpack 4/Jetson Nano. You are using Orin Nano so the sample does not work. You may try this:
Orin Nano Dev Set Up JupyterLab for JetRacer Help - #3 by AastaLLL

Thank you for your reply.

I’m an using a Jetson Nano in this case ,not an Orin Nano.
I did get it to work by downgrading to r32.7.1 (some older version may work, but not the latest for some reason) and more importantly by exposing the csi cam by adding

–volume /tmp/argus_socket:/tmp/argus_socket

to the docker run command

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.