tensorrt not found when using sample python code

I am trying to run the sample tensorflow python code /usr/src/tensorrt/samples/python . Though I was able to import pyCuda , my tensorrt import is failing. any ideas ?

I did see someone else having similar issue and the question was that is there a folder /usr/src/tensorrt . I have the folder but I am not sure what to look for.

New to Nivida nano .

The error message is as follows when:

ModuleNotFoundError Traceback (most recent call last)
3 import pycuda.autoinit
----> 5 import tensorrt as trt

ModuleNotFoundError: No module named ‘tensorrt’

Import tensorflow worked as I was able to run the model.py.



We can import tensorrt with python2.7 and python3.6.
Could you check if TensorRT python package is installed in your environment with this command first?

sudo dpkg -l | grep nvinfer