ERROR: No matching distribution found for torch==1.8.2+cu111
ZBWpro opened this issue · 2 comments
Unattainable Requirements.
pip install torch==1.8.2+cu111 torchtext==0.9.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
# then error
ERROR: Could not find a version that satisfies the requirement torch==1.8.2 (from versions: 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1)
ERROR: No matching distribution found for torch==1.8.2
Guidance on the installation of Pytorch can be accessed from
https://pytorch.org/get-started/locally/.
It's worth mentioning that the testing has been specifically carried out using Nvidia CUDA.
A potential solution to the issue of not finding a suitable version of torch==1.8.2
could involve trying the following steps:
- Check Package Index: Ensure that you have the correct package index configured. You can run the following command to make sure you're using the correct index:
pip config set global.index-url https://download.pytorch.org/whl/torch_stable.html
Linux and Windows
CUDA 11.7
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia
CUDA 11.8
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia
CPU Only
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 cpuonly -c pytorch
This sets the index to the PyTorch package repository.
-
Python Version: Verify that you are using a compatible Python version. PyTorch versions have specific requirements for Python. For example, PyTorch 1.8.2 may require Python 3.6 or later.
-
Update pip: Ensure that you have the latest version of
pip
installed:pip install --upgrade pip
-
Virtual Environment: If you are using a virtual environment, make sure it is activated before attempting to install PyTorch.
-
Network Connection: Confirm that you have a stable network connection, as the installation requires downloading packages.
-
Try Different Version: If
torch==1.8.2
is not crucial, you can try installing a different compatible version of PyTorch, such as the latest stable version.pip install torch
-
Build from Source: If none of the above solutions work, you might consider building PyTorch from source. Instructions for building from source can be found in the PyTorch documentation.
I resolved this issue by replacing Python 3.10 with Python 3.9.