Error installing pytorch using pip

Hi, After running the pytorch installation command for windows (given in the notebook).
I am getting this error,

ERROR: Could not find a version that satisfies the requirement torch==1.7.0+cpu (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.7.0+cpu

can anyone help me about this issue?

@dion11235 where are you trying to install on google-colab or system?

I was trying to install it in my system

ok. Try this, if it works:

conda install pytorch==1.6.0 torchvision==0.7.0 cpuonly -c pytorch

Also, for more help refer to previous pytorch versions and current versions

For pip installation you can also try this-

If you are using Anaconda (3.7) in windows then download and install via .whl file from here.

then put in the working directory and install it using pip.

pip install torch-1.7.0+cpu-cp37-cp37m-win_amd64.whl

For conda installation try this-

  • for new version: conda install pytorch torchvision cpuonly -c pytorch

It will install Torch 1.7 in your anaconda environment

I would highly suggest you to use Anaconda and check for the conda command based on your requirements here https://pytorch.org/. This is simpler.

If you wanna stay with pip then

Check for whether your python is 32-bit or 64-bit, have seen similar issues with 32-bit.

import platform
platform.architecture()

Also can you let me know which python version that you are using?

image

my python is of 64 bit. I am using python 3.9.0. The latest version.

anyway, The problem is resolved now after using conda prompt. Thanks a lot :smile:

2 Likes