Can't install Pytorch in Pycharm terminal, Python 3.10 .win 10

Viewed 6297

I go to pytorch site and take this

pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

I have windows 10 ,Python version is 3.10 ,CUDA version is 11.5

And I get this error

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

I really struggled and tried to solve it, Please help.

2 Answers

Check out the official issue on Pytorch's Github repository. I've tried your exact command on python 3.9.5 and it works. I believe the issue is that PyTorch is not supported by python 3.10 yet.

Downgrading to any 3.9 version of Python should solve your problem.

I know how this problem solves. You need to specify the python interpreter directory in the virtualenv creation line. For example python 3.9 and below. Below is the team that helped me for MacOS.

virtualenv -p  /opt/homebrew/Caskroom/miniforge/base/envs/test_opencv/bin/python env   

Flag -p means -p py, --python py interpreter based on what to create environment (path/identifier) - by default use the interpreter where the tool is installed - first found wins (default: []) from virtualenv -help

You directory might be in usr/local/bin. Hope this will useful.

Related