2

I am trying to install PyTorch 1.3 using pip :

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

I got the command line from this page : https://pytorch.org/get-started/locally/#start-locally

It fails, with the following error message :

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

Using verbose mode (-v) give a little more info :

Skipping link: unsupported archive format: .html: 
   https://download.pytorch.org/whl/torch_stable.html (from -f)
Analyzing links from page https://pypi.org/simple/torch/

It seems pip cannot use the url I provide and will get packages from another URL. That one support at best Python 3.6. Since I have installed 3.7.5 (which is support by URL initially provided) none of the packages match and it fails.

I could downgrade to 3.6 but since 3.7 is officially supported I would like to try to fix that issue first.


EDIT : pip is up to date. I got exact same error on both Windows 10 and 7 64 bit machines. Also: the PyTorch page says :

Please ensure that you have met the prerequisites below (e.g., numpy)

But AFAIK does not list any library in that section. During my tests, numpy was installed and up to date.

As requested, here is the full output of pip : https://pastebin.com/8Wpqp6du

1 Answer 1

1

You error is being triggered because the version 1.3.1+cpu doesn't exist.

If you go to pytorch.org you will be able to select a version of pytorch and your OS, where it will give you a command to install pyTorch correctly, for Python 3.7 and PIP use the following:

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

Remember to check that the pip3 binary you are using is the one installed over Python 3.7.

Also, mind that the documentation you are pointing at is for MacOS.

Sign up to request clarification or add additional context in comments.

7 Comments

Thanks for you answer. I fixed the link. I tried pip3 install torch torchvision you suggest but it fails : pastebin.com/aTbTYzDQ
Does not work either (I got exact same error message). The command line you got is the one generated by the pytorch.org page, with CUDA set on "10.1". The one I posted is set to "None".
Try to update your pip version with python -m pip install --upgrade pip I just intalled it over Linux with pip3 install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html and had no problems at all, also, mind it can be a permissions problem, try to run your CMD as administrator
I have already tried what you suggest before without success. I will try to install python + pytorch on another windows machine.
I got exact same error on a Windows 7 64 bit machine with Python 3.7.0 (installed some months ago). Pip is up to date.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.