ModuleNotFoundError: No module named 'torch'

My Jetson specs look like this.
Jetpack 5.1.1 [L4T 35.3.1]
Ubuntu 20.04 focal

CUDA : 11. 4. 315
cuDNN : 8. 6. 0. 1666
TensorRT : 8. 5. 2. 2
VPI : 2. 2. 7
Vulkan : 1. 3. 204
OpenCV : 4. 5. 4 - with CUDA : NO

and I’m trying. GitHub - NVIDIA-AI-IOT/trt_pose: Real-time pose estimation accelerated with NVIDIA TensorRT
Is there a reason why the output of sudo python3 (python) and python3 (python) are different? And I have tensorrt and torch installed.

@seongone.156 it appears that you are using virtualenv, did you create it with --system-site-packages?

Deactivate or recreate it, then check these:

python3 -c 'import torch'
python3 -c 'import tensorrt'

sudo python3 -c 'import torch'
sudo python3 -c 'import tensorrt'

I used anaconda. I entered the command with it disabled and it l shows me the output, like a photo. What action should I take?

I don’t know what action you should take regarding anaconda. But without it, you are able to import torch and tensorrt through regular python3. So you should be able to install torch2trt outside it.

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