ModuleNotFoundError for 'tensorrt_bindings' in Python with TensorRT on Ubuntu 22.04

Hello,

I am experiencing an issue with TensorRT in Python on my Ubuntu 22.04 system. After installing TensorRT, I’m encountering a ModuleNotFoundError when trying to import TensorRT in Python. I’m seeking assistance to resolve this issue.

System Configuration:

  • OS: Ubuntu 22.04
  • Python Version: 3.10
  • CUDA Version: 11.8
  • cuDNN Version: 8.9.7
  • GCC Version: 11.4 ( now on 8.4 )
  • NVIDIA Driver Version: 470
  • TensorRT Version: 8.6.1 via pip installed

Issue Description: Upon attempting to import TensorRT in my Python virtual environment, I receive the following error:

pythonCopy code

ModuleNotFoundError: No module named 'tensorrt_bindings'

This error occurs when executing the following Python code:

pythonCopy code

import tensorrt as trt

Steps Taken:

  1. Installed TensorRT using the provided wheel file in a Python 3.10 virtual environment.
  2. Ensured that LD_LIBRARY_PATH includes the CUDA and cuDNN library paths.
  3. Attempted to import TensorRT in Python, leading to the error mentioned above.

Additional Information:

  • The TensorRT installation appears to be successful, and the tensorrt package is listed when I run pip list in the virtual environment.
  • My sys.path in Python includes the site-packages directory where TensorRT is installed.

I am looking for guidance on:

  • Resolving the ModuleNotFoundError for tensorrt_bindings.
  • Understanding if there are additional steps or configurations required for TensorRT to work with Python 3.10 on Ubuntu 22.04.
  • Any known compatibility issues or additional dependencies that I might be missing.

Thank you in advance for any help or suggestions!

1 Like

Can you please confirm if you are following the TRT installation Guide?

This issue is still not resolved, pip install tensorrt does not install the required tensorrt-bindings package.

One should manually install it into the environment: pip install tensorrt tensorrt-bindings.

1 Like