Can´t install Pytorch on PyCharm: No matching distribution found for torch==1.7.0+cpu

Viewed 6425

I tried multiple times installing Pytorch on Pycharm. I used the code that the pytorch web site give you for a specific configuration. I use this one: enter image description here

Then I copied this information on Pycharm Terminal and I get this message:

(venv) D:\Usuarios\AuCap\Documents\mnist>pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/w hl/torch_stable.html Looking in links: https://download.pytorch.org/whl/torch_stable.html 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

I also tried installing it using Python interpreter in the Pycharm Settings and also didnd´t work.

Thanks for your help

3 Answers

Downgrade your Python version as python3.9 is not supported by PyTorch right now (python3.8 is fine though). See this issue, it will be supported in subsequent releases.

You can build your own PyTorch from source if you wish though.

Try using "Repair" option in Python Setup Window (Windows options -> Apps -> Find Python -> Modify -> Repair).

I had exactly the same problem and it worked for me.

PS: also make sure you have Python 64-bit version

This now works with Python 3.9 (64 bit) and PyTorch 1.9. Using the website widget I was able to install on Windows using:

pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio===0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

The answer by @Szymon Maszke above was correct at the time it was posted, but the underlying issue has since been patched.

Related