# Unable to run Tensorrt with Python code - AGX Xavier dev kit

**URL:** <https://forums.developer.nvidia.com/t/unable-to-run-tensorrt-with-python-code-agx-xavier-dev-kit/199331>\
**Category:** TensorRT\
**Tags:** jetson-inference, tensorrt, cuda\
**Created:** [December 31, 2021, 11:57am UTC](https://forums.developer.nvidia.com/t/unable-to-run-tensorrt-with-python-code-agx-xavier-dev-kit/199331 "2021-12-31T11:57:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudra](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/rudra/32/139530_2.png) [@Rudra](https://forums.developer.nvidia.com/u/Rudra)\
**Post date:** [December 31, 2021, 11:58am UTC](https://forums.developer.nvidia.com/t/unable-to-run-tensorrt-with-python-code-agx-xavier-dev-kit/199331/1 "2021-12-31T11:58:00Z")

</div>

## Getting error while installing nvidia-tensorrt

> Traceback (most recent call last):  
> File “setup.py”, line 2, in   
> import tensorrt  
> ImportError: No module named tensorrt

Trying to run a python code with tensorrt on AGX dev kit. The `import tensorrt as trt` seems to show tensorrt is there, when I try to run the code, it says:

> Tried following the steps in TensorRT documentation. Installed `PyCUDA`. Installed `nvidia-pyindex` successfully as well. But when I try to install `nvidia-tensorrt`, I get the following error:
> 
> mymachine@ds5:~/torch2trt$ pip3 install nvidia-tensorrt  
> Collecting nvidia-tensorrt  
> Using cached nvidia-tensorrt-0.0.1.dev5.tar.gz (7.9 kB)  
> Preparing metadata (setup.py) … error  
> ERROR: Command errored out with exit status 1:  
> command: /home/mymachine/venv36/bin/python3 -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_294742780ede46439b9ee6b123e81f63/setup.py’“'”‘; **file** =’“'”‘/tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_294742780ede46439b9ee6b123e81f63/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)( **file** ) if os.path.exists( **file** ) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, **file** , ‘"’“‘exec’”’"‘))’ --no-user-cfg egg\_info --egg-base /tmp/pip-pip-egg-info-yg1nzvvk  
> cwd: /tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_294742780ede46439b9ee6b123e81f63/  
> Complete output (16 lines):  
> Traceback (most recent call last):  
> File “”, line 1, in   
> File “/tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_294742780ede46439b9ee6b123e81f63/setup.py”, line 150, in   
> raise RuntimeError(open(“ERROR.txt”, “r”).read())  
> RuntimeError:  
> ###########################################################################################  
> The package you are trying to install is only a placeholder project on [PyPI.org](http://PyPI.org) repository.  
> This package is hosted on NVIDIA Python Package Index.
> 
> This package can be installed as:
> 
> ```auto
> $ pip install nvidia-pyindex
> $ pip install nvidia-tensorrt
> 
> ```
> 
> ###########################################################################################
> 
> * * *
> 
> WARNING: Discarding [https://files.pythonhosted.org/packages/b8/a3/3da2bd25b6243d7a19b6c08c0e92f7c04f9863e70d213fee3141d574dccb/nvidia-tensorrt-0.0.1.dev5.tar.gz#sha256=827ccb3e26fda9d08dc1d8b9aeccaea17134818575245c99488db08825cf0c93](https://files.pythonhosted.org/packages/b8/a3/3da2bd25b6243d7a19b6c08c0e92f7c04f9863e70d213fee3141d574dccb/nvidia-tensorrt-0.0.1.dev5.tar.gz#sha256=827ccb3e26fda9d08dc1d8b9aeccaea17134818575245c99488db08825cf0c93) (from [Links for nvidia-tensorrt](https://pypi.org/simple/nvidia-tensorrt/)). Command errored out with exit status 1: python setup.py egg\_info Check the logs for full command output.  
> Using cached nvidia-tensorrt-0.0.1.dev4.tar.gz (3.8 kB)  
> Preparing metadata (setup.py) … error  
> ERROR: Command errored out with exit status 1:  
> command: /home/mymachine/venv36/bin/python3 -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_c77efecdd6f440dc99ff44ee11f13ac0/setup.py’“'”‘; **file** =’“'”‘/tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_c77efecdd6f440dc99ff44ee11f13ac0/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)( **file** ) if os.path.exists( **file** ) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, **file** , ‘"’“‘exec’”’"‘))’ --no-user-cfg egg\_info --egg-base /tmp/pip-pip-egg-info-l54ksd62  
> cwd: /tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_c77efecdd6f440dc99ff44ee11f13ac0/  
> Complete output (15 lines):  
> Traceback (most recent call last):  
> File “”, line 1, in   
> File “/tmp/pip-install-\_vdh3a3e/nvidia-tensorrt\_c77efecdd6f440dc99ff44ee11f13ac0/setup.py”, line 150, in   
> raise RuntimeError(open(“ERROR.txt”, “r”).read())  
> RuntimeError:  
> ###########################################################################################  
> The package you are trying to install is only a placeholder project on [PyPI.org](http://PyPI.org) repository.  
> This package is hosted on NVIDIA Python Package Index.
> 
> This package can be installed as:
> 
> ```auto
> $ pip install nvidia-pyindex
> $ pip install nvidia-tensorrt
> 
> ```
> 
> ## ###########################################################################################
> 
> WARNING: Discarding [https://files.pythonhosted.org/packages/bf/88/324f19e3cc94c98421072c591ccd8170e0286d818a372eb38d45cc631119/nvidia-tensorrt-0.0.1.dev4.tar.gz#sha256=70f7ce9661852730482e51470f026d12149e53ad61acdf3d79cb5874d3cf677b](https://files.pythonhosted.org/packages/bf/88/324f19e3cc94c98421072c591ccd8170e0286d818a372eb38d45cc631119/nvidia-tensorrt-0.0.1.dev4.tar.gz#sha256=70f7ce9661852730482e51470f026d12149e53ad61acdf3d79cb5874d3cf677b) (from [Links for nvidia-tensorrt](https://pypi.org/simple/nvidia-tensorrt/)). Command errored out with exit status 1: python setup.py egg\_info Check the logs for full command output.  
> ERROR: Could not find a version that satisfies the requirement nvidia-tensorrt (from versions: 0.0.1.dev4, 0.0.1.dev5)  
> ERROR: No matching distribution found for nvidia-tensorrt

## Environment

**TensorRT Version** : 8.0.1.6  
**GPU Type** : AGX Xavier  
**Nvidia Driver Version** : Jetpack 4.6  
**CUDA Version** : 10.2  
**CUDNN Version** : 8.2.1.32  
**Operating System + Version** : Jetpack 4.6  
**Python Version (if applicable)**: python 3.6  
**TensorFlow Version (if applicable)**: 2.7.0  
**PyTorch Version (if applicable)**: 1.10  
**Baremetal or Container (if container which image + tag)**:

---

<div class="post-metadata">

**Author:** ![NVES](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nves/32/14043_2.png) [@NVES](https://forums.developer.nvidia.com/u/NVES)\
**Post date:** [December 31, 2021, 12:38pm UTC](https://forums.developer.nvidia.com/t/unable-to-run-tensorrt-with-python-code-agx-xavier-dev-kit/199331/2 "2021-12-31T12:38:15Z")

</div>

Hi,  
This looks like a Jetson issue. Please refer to the below samlples in case useful.

> **[GitHub - dusty-nv/jetson-inference: Hello AI World guide to deploying deep-learning...](https://github.com/dusty-nv/jetson-inference)**
>
> Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.

> **[GitHub - NVIDIA-AI-IOT/torch2trt: An easy to use PyTorch to TensorRT converter](https://github.com/NVIDIA-AI-IOT/torch2trt)**
>
> An easy to use PyTorch to TensorRT converter

For any further assistance, we recommend you to raise it to the respective platform from the below link

> **[Jetson Systems](https://forums.developer.nvidia.com/c/robotics-edge-computing/jetson-systems/70)**
>
> Discussions relating to the Jetson DevKits and other Embedded computing devices

Thanks!
