ERROR: Could not find a version that satisfies the requirement Solution

$ pip install torch==1.12.0
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement torch==1.12.0 (from versions: 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2)
ERROR: No matching distribution found for torch==1.12.0

The root cause is that python version is too low (3.6). We need to upgrade python to a new version.

If you use conda, just create an env xxx with specific python version:

$ conda create -n xxx python=3.9
$ conda activate xxx

If the issue still persists, double check the pip and python version:

$ pip --version
pip 21.3.1 from /data/.local/lib/python3.6/site-packages/pip (python 3.6)

The above issue can be easily bypassed by python -m pip:

$ python -m pip --version
pip 23.0.1 from /data/miniconda3/envs/alpaca/lib/python3.9/site-packages/pip (python 3.9)

Then everything works fine:

$ python -m pip install torch==1.12.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting torch==1.12.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8f/27/addb0019d7aa3704576ca9c055f7566a3db31f95110e55b31173b87aec4a/torch-1.12.0-cp39-cp39-manylinux1_x86_64.whl (776.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 776.3/776.3 MB 1.8 MB/s eta 0:00:00