'Could not find a version that satisfies the requirement torch>=1.0.0?

Could not find a version that satisfies the requirement torch>=1.0.0 No matching distribution found for torch>=1.0.0 (from stanfordnlp)



Solution 1:[1]

This can also happen if your Python version is too new. Pytorch currently does not support past 3.7.9.

Figured out from: https://stackoverflow.com/a/58902298/5090928

Solution 2:[2]

This is the latest command for pytorch.

pip install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html

Solution 3:[3]

I had some difficulties with this as well. The steps I had to do was:

Install the latest version of PyTorch:

 pip3 install torch===1.3.1 torchvision===0.4.2 -f 
  https://download.pytorch.org/whl/torch_stable.html

Make sure you are installing with 64bit python version; otherwise, it won't work

Solution 4:[4]

I had this same issue while installing standfordnlp in my windows 10 system. Installing torch before installing stanfordnlp worked out for me. I have installed torch from pytorch official website.

Solution 5:[5]

I finally managed to solve this problem thanks to John Red' comment and serg06 answer. Here's what I've done :

  1. Install Python 3.7.9 and not newer.
  2. BUT make sure to install 64bits python

Every other combination failed for me.

Solution 6:[6]

torch and torchvision need python 3.8.x ... so in your CLI run

python --version

to get the python version. make sure that your environment has python 3.8.x, otherwise, create another virtual environment with anaconda

conda create -n myenv python==3.8 anaconda
conda activate myenv

Then install torch and torchvision by this command

pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html

Solution 7:[7]

I went heaven and earth for this problem and here is what it turned out to be:

1- i had python 3.10 2- the python.exe in my virtual environemnt linked to python310

i uninstalled the python3.10 , then went to delete the paths in system environemnts variables (go to windows search, type this thing, you get a window, click on environment variables, and find a word called paths, click edit) ....\python310\ (i named as such when initially installed, you probs have another name) and also this ...python310\Scripts\

delete them

go to https://www.python.org/downloads/release/python-3711/ , istall pythion 3.7 , after that go back to system env. variables thingy, .. add the paths that ends with ...\python37\ , and ...\python37\Scripts\ (make you sure you end the paths with "")

then go to new command prompt, type python , you should get Python 3.7.0 ...

cd to your virtual environment path script (mine looked like this C:\Users...\python_ver\python_projects\root_environment\Scripts>) , activate to the name of whatever you called, for me i typed: activate tf.

type python again, if you have python 3.7 as a result, you good to go ... if you still seeing python 3.10 ... then you probs get some error saying no python in ....\python310\python.exe ... so:

go the folder that you saved python310 (the path shown in the last step), make sure all folders of your python 3.7 go in there.

type python in cmd in the same virtual envrioment path by the cursor ... to check you running pythong 3.7 ...

once python 3.7 is your default .. run the blood Clot for pytorch https://pytorch.org/ to install pytorch

thanks to all the guys on this

Solution 8:[8]

If you have python 3.7 already installed along with newer versions then can use below command to install torch using python 3.7

py -3.7 -m pip install torch

But also note that you have to execute the python program using py -3.7

py -3.7 program_name.py

Solution 9:[9]

I tried every possible command for Windows, but nothing worked. I also tried using Pycharm package installation, everything throws the same error.

Finally installed Pytorch using Anaconda.

Solution 10:[10]

I want to pip install " torch>=1.4.0, torchvision>=0.5.0 ", but in a conda env with python=3.0, this is not right. I tried create a new conda env with python=3.7, and pip install " torch>=1.4.0, torchvision>=0.5.0 " again, it is ok.

Solution 11:[11]

For previous versions please use the snippets from the PyTorch website; https://pytorch.org/get-started/previous-versions/

As an example, this will turn into an error since the cudatoolkit versions are not listed in pip;

!pip install torch==1.10.0+cu111

ERROR: Could not find a version that satisfies the requirement torch==1.10.0+cu111 (from versions: 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0) ERROR: No matching distribution found for torch==1.10.0+cu111

For the same Torch version and cudatoolkit, you can use the following code instead;

!pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html

import torch
TORCH_VERSION = ".".join(torch.__version__.split(".")[:2])
CUDA_VERSION = torch.__version__.split("+")[-1]
print("torch: ", TORCH_VERSION, "; cuda: ", CUDA_VERSION)

Result:

torch:  1.10 ; cuda:  cu111