You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ModuleNotFoundError: No module named 'tensorrt_llm.bindings' #1194
ModuleNotFoundError: No module named 'tensorrt_llm.bindings' the problem not allert
actual behavior
ModuleNotFoundError: No module named 'tensorrt_llm.bindings'
additional notes
I con from annother resposity optimum-nvidia which use TensorRT-LLM, then i clone the main branch , then create a new python file just add
'''
from optimum.nvidia.pipelines import pipeline
then it run and the error just like this

i want to solve the proplem
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/powerop/work/rwq/TensorRT-LLM/tensorrt_llm/__init__.py", line 46, in <module>
from .hlapi.llm import LLM, ModelConfig
File "/home/powerop/work/rwq/TensorRT-LLM/tensorrt_llm/hlapi/__init__.py", line 1, in <module>
from .llm import LLM, ModelConfig
File "/home/powerop/work/rwq/TensorRT-LLM/tensorrt_llm/hlapi/llm.py", line 18, in <module>
from ..executor import (GenerationExecutor, GenerationResult,
File "/home/powerop/work/rwq/TensorRT-LLM/tensorrt_llm/executor.py", line 11, in <module>
import tensorrt_llm.bindings as tllm
ModuleNotFoundError: No module named 'tensorrt_llm.bindings'
We do not support installations in conda environments. This may work but it has not be validated by us. Hence, we cannot provide support for these kinds of installations. Please deploy with docker for full support of the functionality as explained in the installation instructions.
Reacted by Wei Wu, Lu Changqi, nathanael-perraudin-synth, zhuangxing, Rory Finnegan, JoonHoKang, Vishal Agarwal, Zhaoyang Liang, Gilhyeon Lee, Sarah-Xing and 11 more
Renaming .pyi files to .py in the bindings folder seemed to work in a python venv, not sure if it will break anything
Actually! might be related to the next error I got:
File "tensorrt_llm/runtime/model_runner_cpp.py", line 34, in <module>
DataType.FLOAT: torch.float,
^^^^^^^^^^^^^^
AttributeError: type object 'DataType' has no attribute 'FLOAT'
Try to not run python3 -c "import tensorrt_llm" in TensorRT-LLM dicrectory, because it's already have a folder name tensorrt_llm and will cause the error.
Take me about hours to realize :(
Reacted by ZhangJF000, Sergei Kiselev, Jennifer, Makoto Morinaga, Yu Chi, Lin, Bofeng Huang, yacht, Andrew Wang, EDG, jiaan wu and 4 more
Reacted by Pavel Tarashkevich, Andrew Wang, EDG and zhuyinna
Activity
MartinMarciniszyn commentedon Mar 7, 2024
The
bindingsmodule will be found if you install the software following the instructions. Please provide the exact steps to reproduce the issue.ArlanCooper commentedon Mar 12, 2024
how to solve it?
ArlanCooper commentedon Mar 12, 2024
i do the steps as instructions,as following:
but it reports the errors as following:
MartinMarciniszyn commentedon Mar 15, 2024
We do not support installations in
condaenvironments. This may work but it has not be validated by us. Hence, we cannot provide support for these kinds of installations. Please deploy withdockerfor full support of the functionality as explained in the installation instructions.Ednaordinary commentedon Apr 27, 2024
Renaming .pyi files to .py in the bindings folder seemed to work in a python venv,
not sure if it will break anythingActually! might be related to the next error I got:
MarktHart commentedon Apr 27, 2024
For future reference:
This is also a problem when following the steps when building a Docker image. You can solve it by setting
ENV TORCH_CUDA_ARCH_LIST=.peterschmidt85 commentedon Jun 23, 2024
I have the same issue even though I'm using the base CUDA 12.1 Docker image (without conda).
MartinMarciniszyn commentedon Jun 24, 2024
@peterschmidt85 , please post the exact steps to reproduce the issue.
peterschmidt85 commentedon Jun 24, 2024
@MartinMarciniszyn,
nvidia/cuda:12.1.0-devel-ubuntu22.04apt-get update && apt-get -y install python3.10 python3-pip openmpi-bin libopenmpi-devpip3 install tensorrt_llm==0.9.0 -U --extra-index-url https://pypi.nvidia.compython3 -c "import tensorrt_llm"Fails with the problem that it is not compatible with NumPy 2.
After
pip install "numpy<2", I try it again, and it fails withModuleNotFoundError: No module named 'tensorrt_llm.bindings'I was trying to install random versions of
tensorrtandtensorrt_llmand once I got it working but later couldn't find how I did it.MartinMarciniszyn commentedon Jun 24, 2024
@peterschmidt85, please test this with the latest release
0.10.0.peterschmidt85 commentedon Jun 24, 2024
Wow,
0.10.0works. Thank you!Is there any reason why the older version stopped working? I supposed many pinned it and depend on it.
MartinMarciniszyn commentedon Jun 24, 2024
I suspect this might be due to some Python dependencies that were not correctly pinned and evolved in the meanwhile. However, this is just a guess.
peterschmidt85 commentedon Jun 24, 2024
@MartinMarciniszyn Should I use
nvcr.io/nvidia/tritonserver:24.05-trtllm-python-py3with v0.10.0?According to https://github.com/triton-inference-server/triton_cli, they won't work together.
MartinMarciniszyn commentedon Jun 25, 2024
Please see the Triton documentation. If it does not work out of the box, you might need to rebuild the backend for 0.10 from source.
nhduong1203 commentedon Feb 12, 2025
Try to not run
python3 -c "import tensorrt_llm"inTensorRT-LLMdicrectory, because it's already have a folder nametensorrt_llmand will cause the error.Take me about hours to realize :(