Running Python Samples#
You can find the Python samples in GitHub: TensorRT Python Samples. For a complete list of Python samples, refer to the Sample Explorer, or start with the Quick Start section for beginner-friendly options.
Every Python sample includes a README.md file in GitHub: TensorRT Python Samples README that provides detailed information about how the sample works, sample code, and step-by-step instructions on how to run and verify its output.
Python samples require Python 3.10 or newer. Wheel bindings support Python 3.8 through 3.14; refer to Prerequisites and the Support Matrix.
Running a Python sample typically involves two steps:
Install the sample requirements:
python3 -m pip install -r requirements.txt
Run the sample code. If the TensorRT sample data is not in the default location, specify the data directory:
python3 sample.py [-d DATA_DIR]
For more information on running samples, refer to the README.md file included with the sample.