I dare you to show me a set of instructions to install and import `tensorrt` on Windows
Simply try it yourself. Try to install the tensorrt Python package. The instructions do not work. The contents of tensorrt_bindings's __init__.py doesn't make sense.
If you install nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8_1.0-1_amd64.deb, you will get follow
/usr/lib/python3.8/dist-packages/tensorrt/tensorrt.so, add path in env, use pip list |grep tensorrt to check.
Hi @doctorpangloss , please provide more detailed reproduction steps explaining the problem. Are you seeing this issue with TensorRT 10.8 Python packages?
Closing due to inactive. Please feel free to reopen!
Hi @doctorpangloss , please provide more detailed reproduction steps explaining the problem.
These steps do not work for installing tensorrt on windows
choco install -y python
pip install torch==2.7.0+cu126 # ... the torch index
pip install tensorrt
What are the correct steps to install the tensorrt python package on Windows?
pip install tensorrt seems to work fine for me @doctorpangloss
C:\Users\poweiw>pip install tensorrt
Collecting tensorrt
Downloading tensorrt-10.11.0.33.tar.gz (40 kB)
Preparing metadata (setup.py) ... done
Collecting tensorrt_cu12==10.11.0.33 (from tensorrt)
Downloading tensorrt_cu12-10.11.0.33.tar.gz (18 kB)
Preparing metadata (setup.py) ... done
Collecting tensorrt_cu12_libs==10.11.0.33 (from tensorrt_cu12==10.11.0.33->tensorrt)
Downloading tensorrt_cu12_libs-10.11.0.33.tar.gz (709 bytes)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting tensorrt_cu12_bindings==10.11.0.33 (from tensorrt_cu12==10.11.0.33->tensorrt)
Downloading tensorrt_cu12_bindings-10.11.0.33-cp312-none-win_amd64.whl.metadata (607 bytes)
Collecting nvidia-cuda-runtime-cu12 (from tensorrt_cu12_libs==10.11.0.33->tensorrt_cu12==10.11.0.33->tensorrt)
Downloading nvidia_cuda_runtime_cu12-12.9.37-py3-none-win_amd64.whl.metadata (1.7 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 869.5/869.5 kB 6.5 MB/s eta 0:00:00
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 12.5 MB/s eta 0:00:00
Building wheels for collected packages: tensorrt, tensorrt_cu12, tensorrt_cu12_libs
Building wheel for tensorrt (setup.py) ... done
Created wheel for tensorrt: filename=tensorrt-10.11.0.33-py2.py3-none-any.whl size=46648 sha256=ac25c2ebe902f6162f3e54
c70acf9ed563ebca88f83f4c98ebc9e29ffbd3a633
Stored in directory: c:\users\poweiw\appdata\local\pip\cache\wheels\e9\ef\67\9df1a5e26d847859dd55bf1b9cac93bf8ea711741423a379a2
Building wheel for tensorrt_cu12 (setup.py) ... done Created wheel for tensorrt_cu12: filename=tensorrt_cu12-10.11.0.33-py2.py3-none-any.whl size=17498 sha256=e6dd3cea1b0c
3865d20a532f3a67cb4450b51a1a89d00551baa1d7c0f29e0550
Stored in directory: c:\users\poweiw\appdata\local\pip\cache\wheels\81\b2\2b\d6213221c3573bad34b02ba9c1431153063e38b95ca8fc3cba
Building wheel for tensorrt_cu12_libs (pyproject.toml) ... done Created wheel for tensorrt_cu12_libs: filename=tensorrt_cu12_libs-10.11.0.33-py2.py3-none-win_amd64.whl size=153241079
3 sha256=ba34f7f3992074557639f5ea02ad642d51e623c1f024ed5f04df564093a16b55
Stored in directory: c:\users\poweiw\appdata\local\pip\cache\wheels\4e\8d\1e\43cd645e7ece5c1135fb1dffcc29da7acaa4ee37aa39249ef8
Successfully built tensorrt tensorrt_cu12 tensorrt_cu12_libs Installing collected packages: tensorrt_cu12_bindings, nvidia-cuda-runtime-cu12, tensorrt_cu12_libs, tensorrt_cu12, tens
orrt
Successfully installed nvidia-cuda-runtime-cu12-12.9.37 tensorrt-10.11.0.33 tensorrt_cu12-10.11.0.33 tensorrt_cu12_bindings-10.11.0.33 tensorrt_cu12_libs-10.11.0.33
C:\Users\poweiw>python
Python 3.12.7 | packaged by Anaconda, Inc. | (main, Oct 4 2024, 13:17:27) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
>>> print(tensorrt.__version__)
10.11.0.33
Saw your comment with these commands
D:/test3 $ uv venv --python 3.12
Using CPython 3.12.10
Creating virtual environment at: .venv
D:/test3 $ source .venv/scripts/activate
(test3) D:/test3 $ pip install powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"^C
(test3) D:/test3 $ pip install tensorrt
Collecting tensorrt
Downloading tensorrt-10.11.0.33.tar.gz (40 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.7/40.7 kB 483.8 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting tensorrt_cu12==10.11.0.33 (from tensorrt)
Downloading tensorrt_cu12-10.11.0.33.tar.gz (18 kB)
Preparing metadata (setup.py) ... done
Collecting tensorrt_cu12_libs==10.11.0.33 (from tensorrt_cu12==10.11.0.33->tensorrt)
Downloading tensorrt_cu12_libs-10.11.0.33.tar.gz (709 bytes)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting tensorrt_cu12_bindings==10.11.0.33 (from tensorrt_cu12==10.11.0.33->tensorrt)
Downloading tensorrt_cu12_bindings-10.11.0.33-cp311-none-win_amd64.whl.metadata (607 bytes)
Collecting nvidia-cuda-runtime-cu12 (from tensorrt_cu12_libs==10.11.0.33->tensorrt_cu12==10.11.0.33->tensorrt)
Downloading nvidia_cuda_runtime_cu12-12.9.37-py3-none-win_amd64.whl.metadata (1.7 kB)
Downloading tensorrt_cu12_bindings-10.11.0.33-cp311-none-win_amd64.whl (866 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 866.4/866.4 kB 13.6 MB/s eta 0:00:00
Downloading nvidia_cuda_runtime_cu12-12.9.37-py3-none-win_amd64.whl (3.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 22.8 MB/s eta 0:00:00
Building wheels for collected packages: tensorrt, tensorrt_cu12, tensorrt_cu12_libs
Building wheel for tensorrt (setup.py) ... done
Created wheel for tensorrt: filename=tensorrt-10.11.0.33-py2.py3-none-any.whl size=46648 sha256=5551b7840b6299761e9f8f88853eba0e0ba26b0080c2ba4ae8c8ec76393e017d
Stored in directory: c:\users\bberman\appdata\local\pip\cache\wheels\51\0f\9e\665c21496fef6a1b3e8a618503135e16b4a00057f949eb0b70
Building wheel for tensorrt_cu12 (setup.py) ... done
Created wheel for tensorrt_cu12: filename=tensorrt_cu12-10.11.0.33-py2.py3-none-any.whl size=17493 sha256=5380b30e816309677073ded66b8651db45a11426100d265a09c314137d330de4
Stored in directory: c:\users\bberman\appdata\local\pip\cache\wheels\2b\17\10\4409dc0944d985b8eae18e255fd57b6d33318977c0e2fe169a
Building wheel for tensorrt_cu12_libs (pyproject.toml) ... done
Created wheel for tensorrt_cu12_libs: filename=tensorrt_cu12_libs-10.11.0.33-py2.py3-none-win_amd64.whl size=1532410793 sha256=ba34f7f3992074557639f5ea02ad642d51e623c1f024ed5f04df564093a16b55
Stored in directory: c:\users\bberman\appdata\local\pip\cache\wheels\c2\d6\c6\7c9be8eb2ca2ec21baa7eda6a2192d56c1a17efcb8523cdf34
Successfully built tensorrt tensorrt_cu12 tensorrt_cu12_libs
Installing collected packages: tensorrt_cu12_bindings, nvidia-cuda-runtime-cu12, tensorrt_cu12_libs, tensorrt_cu12, tensorrt
Successfully installed nvidia-cuda-runtime-cu12-12.9.37 tensorrt-10.11.0.33 tensorrt_cu12-10.11.0.33 tensorrt_cu12_bindings-10.11.0.33 tensorrt_cu12_libs-10.11.0.33
[notice] A new release of pip is available: 23.3.1 -> 25.1.1
[notice] To update, run: C:\Python311\python.exe -m pip install --upgrade pip
(test3) D:/test3 $ python
Python 3.12.10 (main, Apr 9 2025, 04:06:22) [MSC v.1943 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorrt'
>>> quit()
(test3) D:/test3 $ which python
D:/test3/.venv/Scripts/python.exe
I think for uv, you'll need to use uv pip. See also https://github.com/astral-sh/uv?tab=readme-ov-file#the-pip-interface
C:\Users\poweiw\Documents\test_install>uv venv --python 3.12
Using CPython 3.12.7 interpreter at: C:\Users\poweiw\AppData\Local\anaconda3\python.exe
Creating virtual environment at: .venv
Activate with: .venv\Scripts\activate
C:\Users\poweiw\Documents\test_install>.venv\Scripts\activate
(test_install) C:\Users\poweiw\Documents\test_install>python
Python 3.12.7 | packaged by Anaconda, Inc. | (main, Oct 4 2024, 13:17:27) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorrt'
>>> ^Z
(test_install) C:\Users\poweiw\Documents\test_install>uv pip install tensorrt
Resolved 5 packages in 594ms
Installed 5 packages in 77ms
+ nvidia-cuda-runtime-cu12==12.9.37
+ tensorrt==10.11.0.33
+ tensorrt-cu12==10.11.0.33
+ tensorrt-cu12-bindings==10.11.0.33
+ tensorrt-cu12-libs==10.11.0.33
(test_install) C:\Users\poweiw\Documents\test_install>python
Python 3.12.7 | packaged by Anaconda, Inc. | (main, Oct 4 2024, 13:17:27) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
>>> tensorrt.__version__
'10.11.0.33'