How to install tensorrt to alternative version of python


I’m installing tensorrt in docker container:

# TensorRT
ARG version=""
RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-packages \
    libcudnn8=${version} libcudnn8-dev=${version} && apt-mark hold libcudnn8 libcudnn8-dev

But tensorrt links to python 3.6.9 version I need to work with tensorrt with version 3.9.7 I can not figure how to do this. So when i write in terminal pip list there is no tensorrt with python 3.9.7
How to resolve this?


TensorRT Version:
GPU Type:
Nvidia Driver Version:
CUDA Version:
CUDNN Version:
Operating System + Version:
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Relevant Files

Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)

Steps To Reproduce

Please include:

  • Exact steps/commands to build your repro
  • Exact steps/commands to run your repro
  • Full traceback of errors encountered


As per support doc, TensorRT is supported with python 3.6. Not compatible with other versions.

You can uninstall current TRT and can try the Python wheel files method installation to support other versions of python.

Thank you.

Thanks, I should watch support matrix (