pythonpytorchtorch

Torch installation: No matching distribution found for torch>=2.0.0


I am trying to install version of pytorch as per the requirements.txt file which looks like:

# --------- pytorch --------- #
torch>=2.0.0
torchvision>=0.15.0
lightning>=2.0.0
torchmetrics>=0.11.4

I create a new venv and then run pip install -r requirements.txt

It cannot find the correct version of torch giving this error:

ERROR: No matching distribution found for torch>=2.0.0

What am I doing wrong?


Solution

    1. You need to make sure that your Python version is at least 3.8. You can look at torch's version history to see what Python versions are compatible with which versions of PyTorch.
    2. Also, you need to make sure pip is updated with pip install --upgrade pip