TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

❓ [Question] Cannot install torch-tensorrt package

Open myxzlpltk opened this issue 3 years ago • 1 comments

Hi! Can someone explain why this is error

(tf-gpu-11.6) C:\Users\myxzlpltk>pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
Looking in links: https://github.com/NVIDIA/Torch-TensorRT/releases
Collecting torch-tensorrt
  Using cached torch-tensorrt-0.0.0.post1.tar.gz (9.0 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [13 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\myxzlpltk\AppData\Local\Temp\pip-install-t86xj3rx\torch-tensorrt_a472ada85c9e492d8f4d7d614046053d\setup.py", line 125, 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.
      To install Torch-TensorRT please run the following command:

      $ pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
      ###########################################################################################

      [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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

myxzlpltk avatar Jul 19 '22 01:07 myxzlpltk

Follow these instructions to build torch-tensorrt for windows https://github.com/pytorch/TensorRT/pull/1058

narendasan avatar Jul 19 '22 04:07 narendasan

Screenshot from 2022-09-26 10-11-59 Screenshot from 2022-09-26 10-13-12 I am getting the same error when I want to install torch-tensorrt in ubuntu I have installed pytroch, nvidia-pyindex, and nvidia-tensorrt when I use the command " pip3 install torch-tensorrt==1.1.0 -f https://github.com/pytorch/tensorrt/releases/expanded_assests/1.1.0" or "pip3 install torch-tensorrt==1.1.0 -f https://github.com/pytorch/tensorrt/releases ", I get the following error:

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com Looking in links: https://github.com/pytorch/tensorrt/releases/expanded_assests/1.1.0 ERROR: Could not find a version that satisfies the requirement torch-tensorrt==1.1.0 (from versions: 0.0.0, 0.0.0.post1) ERROR: No matching distribution found for torch-tensorrt==1.1.0

and when I use this command "pip3 install torch-tensorrt" -f https://github.com/pytorch/tensorrt/releases/expanded_assests/" according to this link https://pytorch.org/TensorRT/getting_started/installation.html#installation, I get the following error Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com Looking in links: https://github.com/pytorch/tensorrt/releases/expanded_assests/ Collecting torch-tensorrt Downloading torch-tensorrt-0.0.0.post1.tar.gz (9.0 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [13 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-73y1ow5c/torch-tensorrt_88f670af2a484cdfa6dc96e2467ce1ba/setup.py", line 125, in raise RuntimeError(open("ERROR.txt", "r").read()) RuntimeError: ########################################################################################### The package you are trying to install is only a placeholder project on PyPI.org repository. To install Torch-TensorRT please run the following command:

  $ pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
  ###########################################################################################

  [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.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

How can I fix it?

fatemebafghi avatar Sep 26 '22 06:09 fatemebafghi

This fixed it for me. https://github.com/pytorch/TensorRT/issues/1371#issuecomment-1256035010

gaurav274 avatar Oct 12 '22 04:10 gaurav274

@narendasan why you're not giving the exact installation process? it would be really helpful if you give the installation requirements,

Python version Cuda version support packages version tensorrt version torch_tensorrt version Its becoming challenging for me and everyone to install torch_tensorrt and use it.

IamExperimenting avatar Nov 17 '22 23:11 IamExperimenting

The command for torch-tensorrt installation at official PyTorch docs page is misleading because it is presented as:

pip3 install torch-tensorrt==<VERSION> -f https://github.com/pytorch/TensorRT/releases/expanded_assets/<VERSION>

implying that you need to type the <VERSION> (e.g. 1.2.0) two times in the same format, which is what users above are trying to do. The correct format for this command is:

pip3 install torch-tensorrt==<VERSION> -f https://github.com/pytorch/TensorRT/releases/expanded_assets/v<VERSION>

Notice prepended letter v in v<VERSION> at the very end. So if you want to install 1.2.0 version, you would use:

pip3 install torch-tensorrt==1.1.0 -f https://github.com/pytorch/TensorRT/releases/expanded_assets/v1.1.0

eldarkurtic avatar Mar 18 '23 07:03 eldarkurtic

pip3 install torch-tensorrt==1.1.0 -f https://github.com/pytorch/TensorRT/releases/expanded_assets/v1.1.0

Leads to this error

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Looking in links: https://github.com/pytorch/TensorRT/releases/expanded_assets/v1.1.0

ERROR: Could not find a version that satisfies the requirement torch-tensorrt==1.1.0 (from versions: 0.0.0, 0.0.0.post1)
ERROR: No matching distribution found for torch-tensorrt==1.1.0

pbamotra avatar Apr 29 '23 00:04 pbamotra

@narendasan why you're not giving the exact installation process? it would be really helpful if you give the installation requirements,

Python version Cuda version support packages version tensorrt version torch_tensorrt version Its becoming challenging for me and everyone to install torch_tensorrt and use it.

+1 for this request. I don't understand why this issue was closed, since neither the error message returned by pip mentions that torch_tensorrt needs to be compiled on Windows (if that's the case), nor does the provided link present clear and easy-to-follow instructions on how to do this. I.e. the issue hasn't been resolved.

fmatulic avatar Sep 11 '23 11:09 fmatulic

pip3 install torch-tensorrt==<VERSION> -f https://github.com/pytorch/TensorRT/releases/expanded_assets/<VERSION> Leads to this error

@pbamotra I've the same issue, did you find a solution for this?

Deco354 avatar Jan 04 '24 15:01 Deco354

Geez. Why the F**k not just build this for each version of cuda, torch, and python like other serious tools? Especially when it is such an odd way to build a module.

cooperdk avatar Feb 24 '24 20:02 cooperdk