# Getting error for tensorrt module not found

**URL:** <https://forums.developer.nvidia.com/t/getting-error-for-tensorrt-module-not-found/254286>\
**Category:** TensorRT\
**Tags:** tf-trt, deepstream, tensorrt\
**Created:** [May 24, 2023, 11:41am UTC](https://forums.developer.nvidia.com/t/getting-error-for-tensorrt-module-not-found/254286 "2023-05-24T11:41:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivani.shree](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shivani.shree](https://forums.developer.nvidia.com/u/shivani.shree)\
**Post date:** [May 24, 2023, 11:41am UTC](https://forums.developer.nvidia.com/t/getting-error-for-tensorrt-module-not-found/254286/1 "2023-05-24T11:41:57Z")

</div>

while working with trt pose repository " [GitHub - NVIDIA-AI-IOT/trt\_pose: Real-time pose estimation accelerated with NVIDIA TensorRT](https://github.com/NVIDIA-AI-IOT/trt_pose) "  
getting error while running command : sudo python3 setup.py install

error : ModuleNotFoundError: No module named ‘tensorrt’.

I tried installing tensorrt with this command : “pip install nvidia-pyindex  
pip install nvidia-tensorrt” and its installed “nvidia-tensorrt-99.0.0 and tensorrt-8.6.1”.

But after this also it is throwing the same error that no module named tensorrt.

VM specifications for your reference : NVIDIA-SMI 525.85.12 Driver Version: 525.85.12 CUDA Version: 12.0

what is the correct version of tensorrt that i need to install with this vm specification and what is the command for the installation.

---

<div class="post-metadata">

**Author:** ![spolisetty](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/spolisetty/32/14047_2.png) [@spolisetty](https://forums.developer.nvidia.com/u/spolisetty)\
**Post date:** [May 24, 2023, 12:50pm UTC](https://forums.developer.nvidia.com/t/getting-error-for-tensorrt-module-not-found/254286/2 "2023-05-24T12:50:52Z")

</div>

Hi,

Please checkout [Support Matrix :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/support-matrix/index.html).

Also, we recommend you follow the installation guide.

> **[Installation Guide :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html)**
>
> This NVIDIA TensorRT 8.6.1 Installation Guide provides the installation requirements, a list of what is included in the TensorRT package, and step-by-step instructions for installing TensorRT.

Thank you.

---

<div class="post-metadata">

**Author:** ![shivani.shree](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shivani.shree](https://forums.developer.nvidia.com/u/shivani.shree)\
**Post date:** [May 26, 2023, 10:41am UTC](https://forums.developer.nvidia.com/t/getting-error-for-tensorrt-module-not-found/254286/3 "2023-05-26T10:41:37Z")

</div>

To setup dGPU in Ubuntu 20.04 on Nvidia T4 machine  
[https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS\_Quickstart.html](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html)

1. sudo apt-get update

2. Install Dependencies  
sudo apt install   
libssl1.1   
libgstreamer1.0-0   
gstreamer1.0-tools   
gstreamer1.0-plugins-good   
gstreamer1.0-plugins-bad   
gstreamer1.0-plugins-ugly   
gstreamer1.0-libav   
libgstreamer-plugins-base1.0-dev   
libgstrtspserver-1.0-0   
libjansson4   
libyaml-cpp-dev   
libjsoncpp-dev   
protobuf-compiler   
gcc   
make   
git   
python3

3. Install CUDA Toolkit 11.8  
sudo apt-key adv --fetch-keys [https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86\_64/3bf863cc.pub](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub)  
sudo add-apt-repository “deb [Index of /compute/cuda/repos/ubuntu2004/x86\_64](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/) /”  
sudo apt-get update  
sudo apt-get install cuda-toolkit-11-8

4. Install NVIDIA driver 525.85.12  
wget [https://us.download.nvidia.com/tesla/525.85.12/NVIDIA-Linux-x86\_64-525.85.12.run](https://us.download.nvidia.com/tesla/525.85.12/NVIDIA-Linux-x86_64-525.85.12.run)  
chmod 755 NVIDIA-Linux-x86\_64-525.85.12.run  
sudo ./NVIDIA-Linux-x86\_64-525.85.12.run --no-cc-version-check

5. Install PyTorch  
[Start Locally | PyTorch](https://pytorch.org/get-started/locally/)  
pip3 install torch torchvision torchaudio --index-url [https://download.pytorch.org/whl/cu118](https://download.pytorch.org/whl/cu118)

6. Install tensorrt  
[Installation Guide :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html)  
a. wget [https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86\_64-gnu.cuda-12.0.tar.gz](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz)  
b. tar -xzvf TensorRT-8.6.1.6.Linux.x86\_64-gnu.cuda-12.0.tar.gz  
c. cd TensorRT-8.6.1.6/lib  
d. pwd → output (/home/mastekinnovation/TensorRT-8.6.1.6/lib)  
e. export LD\_LIBRARY\_PATH=/home/mastekinnovation/TensorRT-8.6.1.6/lib  
f. cd TensorRT-8.6.1.6/python  
g. python3 -m pip install tensorrt-8.6.1-cp38-none-linux\_x86\_64.whl  
h. cd TensorRT-8.6.1.6/uff  
i. python3 -m pip install uff-0.6.9-py2.py3-none-any.whl  
j. cd TensorRT-8.6.1.6/graphsurgeon  
k. python3 -m pip install graphsurgeon-0.4.6-py2.py3-none-any.whl  
l. cd TensorRT-8.6.1.6/onnx\_graphsurgeon  
m. python3 -m pip install onnx\_graphsurgeon-0.3.12-py2.py3-none-any.whl

7. Install torch2trt  
[GitHub - NVIDIA-AI-IOT/trt\_pose: Real-time pose estimation accelerated with NVIDIA TensorRT](https://github.com/NVIDIA-AI-IOT/trt_pose)  
git clone [GitHub - NVIDIA-AI-IOT/torch2trt: An easy to use PyTorch to TensorRT converter](https://github.com/NVIDIA-AI-IOT/torch2trt)  
cd torch2trt  
sudo python3 setup.py install --plugins

At this point we are getting “tensorrt module not found”  
Please help

![tensorrt](https://global.discourse-cdn.com/nvidia/original/3X/2/d/2ddc90be8aba51639c3cdb61a3add984f628d22a.png)

---

<div class="post-metadata">

**Author:** ![AakankshaS](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aakankshas/32/14047_2.png) [@AakankshaS](https://forums.developer.nvidia.com/u/AakankshaS)\
**Post date:** [May 29, 2023, 5:33am UTC](https://forums.developer.nvidia.com/t/getting-error-for-tensorrt-module-not-found/254286/4 "2023-05-29T05:33:42Z")

</div>

Hi,  
Please refer to the installation steps from the below link if in case you are missing on anything

> **[Installation Guide :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html)**
>
> This NVIDIA TensorRT 8.6.1 Installation Guide provides the installation requirements, a list of what is included in the TensorRT package, and step-by-step instructions for installing TensorRT.

Also, we suggest you to use TRT NGC containers to avoid any system dependency related issues.

> **[TensorRT | NVIDIA NGC](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorrt)**
>
> NVIDIA TensorRT is a C++ library that facilitates high-performance inference on NVIDIA graphics processing units (GPUs). TensorRT takes a trained network and produces a highly optimized runtime engine that performs inference for that network.

Thanks!
