pip cannot find any PyTorch build for this Python or machine
Your error
ERROR: Could not find a version that satisfies the requirement torch==1.7.1 (from versions: 2.2.0, 2.2.1, 2.2.2, ...)2 more lines it can showFix it fast
Most common cause, 1 of 4The Python version is outside the range the pinned torch was built for
Either move to a torch release that has wheels for your Python, or create a virtual environment with a Python that the old release supports.
# keep your Python, use a current torch
python -m pip install torch
# or keep the old pin, use a matching Python (Windows)
py -3.9 -m venv .venv-torch17
.venv-torch17\Scripts\python -m pip install torch==1.7.1Short answer
pip prints "Could not find a version that satisfies the requirement torch" when no torch wheel fits your interpreter and machine. torch 2.15 ships only for Python 3.11 to 3.15 on 64-bit Windows, Linux and Apple Silicon. Old pins like 1.7.1 stop at Python 3.9, and +cu builds live on download.pytorch.org, not PyPI. Applies to pip 26 and torch 2.15.
Which cause do you have?
Show which Python and machine pip is installing for, then ask the index which torch versions it can see for that setup. An empty or short list points at the interpreter or the platform; a full list that lacks your pin points at the pin.
python -c "import sys, platform, struct; print(sys.version.split()[0], platform.system(), platform.machine(), struct.calcsize('P') * 8, 'bit')"
python -m pip index versions torchThen find the line you see in this list and open its fix:
- 1The Python version is outside the range the pinned torch was built for
pip index versions shows a list, but your pinned version is missing from it, or the list is empty on a very new or very old Python - 2The machine or interpreter has no torch wheels at all
pip index versions torch returns nothing, and the first command shows 32 bit, macOS on x86_64, or an old Linux distribution - 3A CUDA build was requested from PyPI
The failing requirement has a +cu or +cpu suffix, such as torch==2.14.1+cu126, or the project needs a CUDA flavour PyPI does not carry - 4conda is asked for a release the pytorch channel never got
conda install pytorch -c pytorch cannot find any recent version, while the same version installs fine with pip
What does the error look like?
ERROR: Could not find a version that satisfies the requirement torch==1.7.1 (from versions: 2.2.0, 2.2.1, 2.2.2, ...)ERROR: No matching distribution found for torch==1.7.1ERROR: No matching distribution found for torch==2.14.1+cu126
Cause 1 of 4
The Python version is outside the range the pinned torch was built for
You seepip index versions shows a list, but your pinned version is missing from it, or the list is empty on a very new or very old Python
Check
Each torch release ships wheels for a fixed set of Python versions, and pip skips the rest. On PyPI, torch 2.15.0 requires Python 3.11 or later and has cp311 to cp315 wheels. Older pins are narrower: 2.0.1 covers Python 3.8 to 3.11 and 1.7.1 stops at 3.9, so a current Python cannot install them at all.
python -m pip install --dry-run --no-deps torch==1.7.1Fix
Either move to a torch release that has wheels for your Python, or create a virtual environment with a Python that the old release supports. On Windows the py launcher picks the version.
# keep your Python, use a current torch
python -m pip install torch
# or keep the old pin, use a matching Python (Windows)
py -3.9 -m venv .venv-torch17
.venv-torch17\Scripts\python -m pip install torch==1.7.1Verify
The install finishes and torch imports with the expected version.
python -c "import torch; print(torch.__version__)"Confirmed by pypi.org
Cause 2 of 4
The machine or interpreter has no torch wheels at all
You seepip index versions torch returns nothing, and the first command shows 32 bit, macOS on x86_64, or an old Linux distribution
Check
torch 2.15 publishes wheels only for win_amd64, manylinux_2_28 on x86_64 and aarch64, and macosx_14_0_arm64. A 32-bit Python on Windows gets nothing, the last Intel Mac wheels on PyPI are torch 2.2.2, Apple Silicon needs macOS 14 or later for current wheels, and PyTorch's install guide asks for glibc 2.28 or newer on Linux.
# Linux: glibc version
ldd --version | head -1
# macOS: system version
sw_vers -productVersionFix
Install a 64-bit Python on Windows, move an old Linux host to a distribution with glibc 2.28 or newer (or run the job in a current container image), and on an Intel Mac pin torch 2.2.2 with Python 3.12 or older.
# Intel Mac: newest release that still has x86_64 wheels
python3.12 -m venv .venv
.venv/bin/python -m pip install torch==2.2.2Verify
pip index versions torch now lists versions, and the install no longer stops at the resolver.
python -m pip index versions torchConfirmed by pytorch.org
Cause 3 of 4
A CUDA build was requested from PyPI
You seeThe failing requirement has a +cu or +cpu suffix, such as torch==2.14.1+cu126, or the project needs a CUDA flavour PyPI does not carry
Check
Builds for a specific CUDA, ROCm or CPU-only flavour come from PyTorch's own wheel indexes. The previous-versions page installs them with --index-url https://download.pytorch.org/whl/<flavour>, so asking plain PyPI for a +cu version finds nothing.
grep -n "torch" requirements.txtFix
Drop the local +cu tag from the pin and point pip at the index for the flavour you need.
python -m pip install torch==2.14.1 torchvision==0.29.1 --index-url https://download.pytorch.org/whl/cu126Verify
torch reports the CUDA version of the index you used.
python -c "import torch; print(torch.__version__, torch.version.cuda)"Confirmed by pytorch.org
Cause 4 of 4
conda is asked for a release the pytorch channel never got
You seeconda install pytorch -c pytorch cannot find any recent version, while the same version installs fine with pip
Check
PyTorch announced that 2.5 was the last release published to the pytorch channel on Anaconda. Newer releases exist only as wheels on PyPI and download.pytorch.org, or as conda-forge packages maintained outside the PyTorch team.
conda search -c pytorch pytorchFix
Inside the conda environment, install torch with pip from PyPI or the PyTorch index, or switch to the conda-forge package.
conda activate my-env
python -m pip install torch --index-url https://download.pytorch.org/whl/cu132
# or
conda install -c conda-forge pytorchVerify
The environment imports the new torch version.
python -c "import torch; print(torch.__version__)"Confirmed by github.com
How do I stop it coming back?
- Pin the Python version next to the torch version (in pyproject.toml requires-python or the Dockerfile base image), so both move together.
- Keep the CUDA flavour in the index URL rather than in the version string, and put that URL in one place such as a pip.conf or requirements header.
- Run pip install --dry-run for the requirements file on each target platform in CI before the real build.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: stegnor.com, Menulo, ShopGo.