(studysession) C:UsersStevenPyTorch>pip install torch
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
Do I need to downgrade to Python 3.7.?
(studysession) C:UsersStevenPyTorch>pip install torch
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
Do I need to downgrade to Python 3.7.?
2
Answers
From the project page on pypi, it says it requires: Python >=3.8.0. So upgrade your python version if it isn’t upgraded. Open a terminal, then run
pip install torch
.Advice: run this in a virtual environment instead of globally.
You can refer to the get-started page of pytorch, select the proper language and compute platform, then copy the command and install pytorch to your computer.
Attention: If you use global python interpreter, pytorch will be installed globally, which could be risky. So the better way is to use
conda
orpip
to create a virtual python environment and then install pytorch in it.After the installation of pytorch, you need to install the
python
plugin in vscode. Then you can get the pytorch autocompletion in vscode after you choose the proper python interpreter.