installing tensorrt in conda env
Asked Answered
B

2

9

I am trying to install tensorrt in conda env and I have the cudatoolkit and cudnn installed in my env through conda navigator. I have also updated my pip and setuptool but the get the below error what should i do?

Error:

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting nvidia-tensorrt
  Downloading nvidia-tensorrt-0.0.1.dev5.tar.gz (7.9 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Zaniar.J\AppData\Local\Temp\pip-install-j1d5secx\nvidia-tensorrt_4052b513fcf14f1c9e44ac829f00ae55\setup.py", line 150, in <module>
          raise RuntimeError(open("ERROR.txt", "r").read())
      RuntimeError:
      ###########################################################################################
      The package you are trying to install is only a placeholder project on PyPI.org repository.
      This package is hosted on NVIDIA Python Package Index.

      This package can be installed as:
      ```
      $ pip install nvidia-pyindex
      $ pip install nvidia-tensorrt
      ```
      ###########################################################################################

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.
Backstay answered 13/9, 2022 at 12:33 Comment(2)
How are you trying to install it?Mcdade
with pip---pip install nvidia-tensorrtBackstay
M
7

Have a look at the instructions here, and as the error suggests you first have to install:

pip install nvidia-pyindex

After that you can do:

pip install --upgrade nvidia-tensorrt
Mcdade answered 13/9, 2022 at 13:4 Comment(1)
I believe the package is pip install tensorrt --extra-index-url https://pypi.nvidia.com (version 8.6) and not nvidia-tensorrt which is version 99. In other nvidia- packages there is a warning: "WARNING: This project is not functional and is a placeholder from NVIDIA." cf pypi.org/project/nvidia-cudnnEdmundedmunda
D
0

Considering you already have a conda environment with Python (3.6 to 3.10) installation and CUDA, you can pip install nvidia-tensorrt Python wheel file through regular pip installation (small note: upgrade your pip to the latest in case any older version might break things python3 -m pip install --upgrade setuptools pip):

conda create --name env_3 python=3.9
conda activate env_3
python3 -m pip install --upgrade nvidia-tensorrt
python3 -m pip install nvidia-pyindex

You can also check the installation by entering python3on cmd line and typing out some python tests:

import tensorrt
print(tensorrt.__version__)
assert tensorrt.Builder(tensorrt.Logger())

In case you have errors, most precise documentation is the official one

Dragonfly answered 13/10, 2022 at 19:54 Comment(1)
I understand that python3 -m pip install nvidia-pyindex shall be issued before the installation of nvidia-tensort as this last extends the default pypi package index with and additional nvidia indexAntilogy

© 2022 - 2024 — McMap. All rights reserved.