How to reinstall tensorrt?

HI,
I can’t import tensorrt in python3
This is my error msg.

import tensorrt
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python3.8/dist-packages/tensorrt/init.py”, line 68, in
from .tensorrt import *
ImportError: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined symbol: _ZN5nvdla8IProfile17setUseSoftMaxOptzEb

so i want to reinstall tensorrt but I can’t remove it.

nvidia@nvidia-desktop:~$ python3 -m pip uninstall tensorrt
Found existing installation: tensorrt 8.4.1.5
Uninstalling tensorrt-8.4.1.5:
Would remove:
/usr/lib/python3.8/dist-packages/tensorrt-8.4.1.5.dist-info/*
/usr/lib/python3.8/dist-packages/tensorrt/*
Proceed (Y/n)? Y
ERROR: Exception:
Traceback (most recent call last):
File “/usr/lib/python3.8/shutil.py”, line 791, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: ‘/usr/lib/python3.8/dist-packages/tensorrt-8.4.1.5.dist-info/’ → ‘/tmp/pip-uninstall-0076_l43’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/nvidia/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py”, line 169, in exc_logging_wrapper
status = run_func(*args)
File “/home/nvidia/.local/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py”, line 105, in run
uninstall_pathset = req.uninstall(
File “/home/nvidia/.local/lib/python3.8/site-packages/pip/_internal/req/req_install.py”, line 680, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File “/home/nvidia/.local/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py”, line 381, in remove
moved.stash(path)
File “/home/nvidia/.local/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py”, line 272, in stash
renames(path, new_path)
File “/home/nvidia/.local/lib/python3.8/site-packages/pip/_internal/utils/misc.py”, line 313, in renames
shutil.move(old, new)
File “/usr/lib/python3.8/shutil.py”, line 809, in move
rmtree(src)
File “/usr/lib/python3.8/shutil.py”, line 718, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File “/usr/lib/python3.8/shutil.py”, line 675, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File “/usr/lib/python3.8/shutil.py”, line 673, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: ‘LICENSE.txt’

how can i reinstall tensorrt??

You can install NVIDIA SDK Manager to your PC and select the Download Only option, it will download the original debian packages to your PC, which you could then copy to your Jetson and install with dpkg.

Can you explain more detail for me??
I understand about pkg download via sdkmanager. after that how should I do ??

I want to forced reinstall tensorrt…

sorry
I understood and trying now!!

I can’t import tensorrt in python3 after installation from .deb pkg file of tensorrt.

is it correct??

but I can find tensorrt pkgs with command : “dpkg -l | grep TensorRT”.

ii graphsurgeon-tf 8.4.1-1+cuda11.4 arm64 GraphSurgeon for TensorRT package
ii libnvinfer-bin 8.4.1-1+cuda11.4 arm64 TensorRT binaries
ii libnvinfer-dev 8.4.1-1+cuda11.4 arm64 TensorRT development libraries and headers
ii libnvinfer-plugin-dev 8.4.1-1+cuda11.4 arm64 TensorRT plugin libraries
ii libnvinfer-plugin8 8.4.1-1+cuda11.4 arm64 TensorRT plugin libraries
ii libnvinfer-samples 8.4.1-1+cuda11.4 all TensorRT samples
ii libnvinfer8 8.4.1-1+cuda11.4 arm64 TensorRT runtime libraries
ii libnvonnxparsers-dev 8.4.1-1+cuda11.4 arm64 TensorRT ONNX libraries
ii libnvonnxparsers8 8.4.1-1+cuda11.4 arm64 TensorRT ONNX libraries
ii libnvparsers-dev 8.4.1-1+cuda11.4 arm64 TensorRT parsers libraries
ii libnvparsers8 8.4.1-1+cuda11.4 arm64 TensorRT parsers libraries
ii python3-libnvinfer 8.4.1-1+cuda11.4 arm64 Python 3 bindings for TensorRT
ii python3-libnvinfer-dev 8.4.1-1+cuda11.4 arm64 Python 3 development package for TensorRT
ii tensorrt 8.4.1.5-1+cuda11.4 arm64 Meta package for TensorRT
ii uff-converter-tf 8.4.1-1+cuda11.4 arm64 UFF converter for TensorRT package

what should I do to import tensorrt in python3?

Hi,

It looks like you are using JetPack 4?

We only provide the prebuilt package for the default Python package.
For JetPack 4, it’s Python 3.6.

If you need the binding for other Python versions.
Please follow the guide below to build a custom binding.

Thanks.

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