How to Fix ERROR: Could not find a version that satisfies the requirement torch (from versions: none)

Tadashi Shigeoka ·  Tue, January 2, 2024

I’ll introduce how I resolved ERROR: Could not find a version that satisfies the requirement torch (from versions: none) and successfully installed PyTorch.

$ pip install torch
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
$ python -V
Python 3.12.1

I confirmed that I seemed to meet the installation requirements from INSTALL PYTORCH on the PyTorch official site.

NOTE: Latest PyTorch requires Python 3.8 or later. For more details, see Python section below.

Since it stated the above, I checked torch · PyPI and found that Python is only supported up to 3.10.

Programming Language * C++ * Python :: 3 * Python :: 3.8 * Python :: 3.9 * Python :: 3.10

I checked https://www.python.org/downloads/ and installed the latest 3.10.* version, 3.10.13.

asdf install python 3.10.13
asdf local python 3.10.13
$ pip install torch
...
Installing collected packages: mpmath, typing-extensions, sympy, networkx, MarkupSafe, fsspec, filelock, jinja2, torch
Successfully installed MarkupSafe-2.1.3 filelock-3.13.1 fsspec-2023.12.2 jinja2-3.1.2 mpmath-1.3.0 networkx-3.2.1 sympy-1.12 torch-2.1.2 typing-extensions-4.9.0

That’s all from the Gemba, where I successfully installed PyTorch.