How to install tensorRT for python2.7 on TX2

I tried to install tensorRT 4.0 on TX2 with tar file, because my cudnn is 7.1.
However, after I pip install .whl in the TensorRT4.0/python folder and tried to import tensorrt in python2.7, I got this error:

Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorrt
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.7/dist-packages/tensorrt/”, line 71, in
from tensorrt import infer, parsers, utils, lite, plugins
File “/usr/local/lib/python2.7/dist-packages/tensorrt/infer/”, line 50, in
from ._infer_enums import *
File “/usr/local/lib/python2.7/dist-packages/tensorrt/infer/”, line 54, in
from tensorrt.infer import _nv_infer_bindings as nvinfer
ImportError: /usr/local/lib/python2.7/dist-packages/tensorrt/infer/ cannot open shared object file: No such file or directory

But the exists in that folder.
What should I do?


Please install TensorRT through the Jetson specific Software Manager, JetPack:

You should be able to setup TensorRT for Python through this.

NVIDIA Enterprise Support