Install & Compatibility
Where this runs
tested against v10.16.1.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 78.4s · import 0.000s · 6348.8MB
6349MB installed
● package 6349MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
tensorrt
✓ import tensorrt as trt
✗ from tensorrt import *
Importing all with * pollutes namespace; use alias trt.
Verifies TensorRT installation and creates a trivial identity engine.
import tensorrt as trt
import os
# Verify installation
print(f"TensorRT version: {trt.__version__}")
# Create a logger
logger = trt.Logger(trt.Logger.WARNING)
# Build a simple identity network
builder = trt.Builder(logger)
network = builder.create_network(1 << int(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH))
# Add an input tensor
input_tensor = network.add_input(name="input", dtype=trt.float32, shape=(1, 3, 224, 224))
# Add an identity layer (pass-through)
identity = network.add_identity(input_tensor)
# Mark output
network.mark_output(identity.get_output(0))
# Build engine
config = builder.create_builder_config()
config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, 1 << 30) # 1 GB
engine_bytes = builder.build_serialized_network(network, config)
if engine_bytes:
print("Engine built successfully")
else:
print("Engine build failed")
Upgrade
Version history
11.1.0.106latest on PyPI · released Jun 16, 2026
Audit
Dependencies
tensorrt-cu12-bindingsrequiredPython bindings that wrap the libraries; both must match version exactly.
cuda-pythonoptionalRequired for CUDA context management and memory transfers in Python workflows.