Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 441
Nicolas Zarges Avatar asked Nov 01 '20 19:11

Nicolas Zarges


People also ask

Can I install PyTorch in Pycharm?

If an error comes then try to search for the torch and install it otherwise it is successfully installed. If you are seeing an error like this “Error occurred when installing Package Pytorch“. Then you should install Pytorch through Pycharm Terminal. That's all you have to do for installing Pytorch in Pycharm.

What version of Python does PyTorch support?

Python. Currently, PyTorch on Windows only supports Python 3.7-3.9; Python 2.x is not supported.

Does PyTorch support CPU?

In addition to that, PyTorch can also be built with support of external libraries, such as MKL and MKL-DNN, to speed up computations on CPU.

How do I install Python torch library?

To install PyTorch, you have to run the installation command of PyTorch on your command prompt. This command is available on https://pytorch.org/. Select language and cuda version as per your requirement. Now, run python -version, and Conda -version command to check Conda and python packages are installed or not.


2 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.

like image 186
Szymon Maszke Avatar answered Sep 23 '22 09:09

Szymon Maszke


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

like image 28
Merifest Avatar answered Sep 22 '22 09:09

Merifest