swor
swor

Reputation: 901

Could not find a version that satisfies the requirement torch==1.7.0+cpu

I want to install torch==1.7.0+cpu from requirements.txt I have an error

Could not find a version that satisfies the requirement torch==1.7.0+cpu (from -r requirements.txt (line 42)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.1, 0.4.0, 0.4.1, 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) No matching distribution found for torch==1.7.0+cpu

I am using

Python 3.6.12 (default, Aug 18 2020, 02:08:22) 
[GCC 5.4.0 20160609] on linux

Upvotes: 1

Views: 19667

Answers (3)

razimbres
razimbres

Reputation: 5015

For CPU you can run:

conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cpuonly -c pytorch

or for GPU:

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html

Check this link:

https://pytorch.org/get-started/previous-versions/

Upvotes: 2

Aajinkya Singh
Aajinkya Singh

Reputation: 703

If you have this issue while installing your modules from requirements.txt then you could simply add the following line to the top of your requirements.txt file

-f https://download.pytorch.org/whl/torch_stable.html

Upvotes: 5

swor
swor

Reputation: 901

This command helped me

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

Upvotes: 3

Related Questions