PyTorch: ERROR: Could not find a version that satisfies the requirement torch==1.6.0
This error occurs when Python tries to install a legacy PyTorch version (like torch==1.6.0) on modern Python 3.10+ or ARM64 architectures where wheels do not exist. Upgrade your code to modern PyTorch 2.x or use Python 3.8.
Root Cause Analysis
This error occurs when a developer or legacy requirement file (requirements.txt) requests an obsolete version of PyTorch (such as torch==1.6.0 or torch==1.7.1) on a modern Python environment (Python 3.10, 3.11, 3.12) or modern hardware architecture (Apple Silicon ARM64 / Windows ARM64).
Root Cause 1: Incompatible Python Version Wheels on PyPI
PyTorch 1.6.0 was released in 2020 and only published pre-compiled binary wheels for Python 3.6, 3.7, and 3.8. When pip runs on Python 3.10+, it searches PyPI for a wheel matching the current Python ABI (cp310, cp311, cp312). Because no matching wheel exists, pip fails with ERROR: Could not find a version that satisfies the requirement torch==1.6.0.
Root Cause 2: Hardware Architecture Missing Pre-Built Binaries
PyTorch 1.6.0 did not provide pre-compiled wheels for Apple Silicon (arm64 / M1/M2/M3) or Windows ARM64, as these architectures were introduced in later PyTorch releases (1.12+).
Root Cause 3: Deprecated PyTorch pip Index URLs
Older tutorials instructed users to install PyTorch using legacy wheel index URLs (such as https://download.pytorch.org/whl/torch_stable.html) which have been superseded by modern compute-specific channels (cu118, cu121, cpu).
Root Cause 4: Pinned Outdated Dependencies in GitHub Repositories
Cloning legacy research codebases with strict pinned dependencies (torch==1.6.0, torchvision==0.7.0) prevents running the code on modern development machines.
Reproduction Code (MCVE)
import sys
# Simulating pip wheel compatibility resolution failure
def check_wheel_compatibility(requested_torch_ver: str, current_py_ver: str):
if requested_torch_ver == "1.6.0" and int(current_py_ver.split(".")[1]) >= 10:
raise OSError(
f"ERROR: Could not find a version that satisfies the requirement torch=={requested_torch_ver} "
f"(from versions: none). No matching distribution found for Python {current_py_ver}. "
"PyTorch 1.6.0 only supports Python <= 3.8."
)
# Simulating attempt to install PyTorch 1.6.0 on Python 3.11
check_wheel_compatibility("1.6.0", "3.11.4")
Solution 1: Upgrade to Modern PyTorch 2.x for Current Python Version
Update your requirements to use modern PyTorch 2.x, which is backwards-compatible with most 1.x model code while supporting Python 3.10–3.12.
# Solution 1: Modern PyTorch installation command
modern_install = "pip install --upgrade torch torchvision torchaudio"
print("Recommended command:")
print(f" $ {modern_install}")
assert "pip install" in modern_install
Solution 2: Create a Python 3.8 Virtual Environment for Legacy Code
If the legacy codebase strictly requires PyTorch 1.6.0 and cannot be refactored, create a dedicated Python 3.8 conda environment.
# Solution 2: Legacy environment setup steps
legacy_env_steps = [
"conda create -n legacy_torch python=3.8 -y",
"conda activate legacy_torch",
"pip install torch==1.6.0 torchvision==0.7.0"
]
print("Legacy environment creation steps:")
for step in legacy_env_steps:
print(f" $ {step}")
assert len(legacy_env_steps) == 3
Do not attempt to compile PyTorch 1.6.0 from source on Python 3.11+. The underlying C++ codebase relies on deprecated CPython C-API functions that were removed in Python 3.10 and will fail to compile. Either upgrade PyTorch or downgrade the Python interpreter.
Note de reproductibilité : Cette erreur dépend de la version de l'interpréteur Python actif (3.8 vs 3.10+) et de l'architecture processeur hôte (x86_64 vs arm64).
Contrast Could not find a version with No matching distribution found: Both indicate pip cannot find compatible pre-compiled wheels or source packages for your operating system and Python version.