Fixed: Distribution torch==2.15.0+cu132 can't be installed because it doesn't have a source distribution or wheel for the current platform
I pointed torch at PyTorch's CUDA 13.2 index in pyproject.toml, and uv add torch failed on my Mac: Distribution `torch==2.15.0+cu132 @ registry+https://download.pytorch.org/whl/cu132` can't be installed because it doesn't have a source distribution or wheel for the current platform. PyTorch publishes no CUDA builds for macOS. Limiting the index to Windows with a marker fixed it.
What I Was Doing
I wanted the project to get PyTorch's CUDA build, which on Windows comes only from PyTorch's own package index. I made a project with uv 0.13.10 on Python 3.15.2:
uv init --python 3.15 gpu-app
cd gpu-app
Then I added these lines to the end of pyproject.toml, sending torch to the index for CUDA 13.2:
[tool.uv.sources]
torch = [
{ index = "pytorch-cu132" },
]
[[tool.uv.index]]
name = "pytorch-cu132"
url = "https://download.pytorch.org/whl/cu132"
explicit = true
And added PyTorch:
uv add torch
What I Expected
PyTorch added to the project, with the CUDA build wherever there is one.
What I Got
Using CPython 3.15.2 interpreter at: /Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15
Creating virtual environment at: .venv
Resolved 28 packages in 907ms
error: Distribution `torch==2.15.0+cu132 @ registry+https://download.pytorch.org/whl/cu132` can't be installed because it doesn't have a source distribution or wheel for the current platform
hint: You're on macOS (`macosx_26_0_arm64`), but `torch` (v2.15.0+cu132) only has wheels for the following platforms: `manylinux_2_28_aarch64`, `manylinux_2_28_x86_64`, `win_amd64`; consider adding "sys_platform == 'darwin' and platform_machine == 'arm64'" to `tool.uv.required-environments` to ensure uv resolves to a version with compatible wheels

uv resolved the packages, then refused to install torch 2.15.0+cu132 on this Mac, and pyproject.toml still had no dependencies afterwards.
What I Checked
The hint lists the systems the build exists for: manylinux_2_28_aarch64 and manylinux_2_28_x86_64 (Linux) and win_amd64 (64-bit Windows). There's no macOS among them. The uv guide to PyTorch says the same, and shows the way around it: "PyTorch doesn't publish CUDA builds for macOS. As such, we gate on sys_platform to instruct uv to use the PyTorch index on Linux and Windows, but fall back to PyPI on macOS".
Why It Happens
An entry in [tool.uv.sources] without a marker applies on every system. So uv took torch from the CUDA index for macOS too, where that index has nothing to install. A Mac doesn't need it anyway: PyTorch uses the GPU of an Apple silicon Mac through MPS, which PyPI's build already includes.
I also tried the hint's suggestion: I added required-environments = ["sys_platform == 'darwin' and platform_machine == 'arm64'"] under [tool.uv]. uv then failed earlier, while resolving, ending in we can conclude that your project's requirements are unsatisfiable: the setting makes uv demand a macOS file, and the CUDA index has none to give.
The Fix
Give the entry a marker, so the CUDA index is used only where it's needed. PyPI's Linux build already uses CUDA 13.2, so Windows is the only system that needs PyTorch's index:
[tool.uv.sources]
torch = [
{ index = "pytorch-cu132", marker = "sys_platform == 'win32'" },
]
[[tool.uv.index]]
name = "pytorch-cu132"
url = "https://download.pytorch.org/whl/cu132"
explicit = true

uv add torch
+ mpmath==1.3.0
+ networkx==3.7
+ setuptools==84.2.1
+ sympy==1.14.0
+ torch==2.15.0
+ typing-extensions==4.16.0

After the Fix
uv tree shows what the lockfile gives each system:
uv tree --python-platform windows --depth 1
uv tree --python-platform macos --depth 1
Resolved 29 packages in 7ms
gpu-app v0.1.0
└── torch v2.15.0+cu132
Resolved 29 packages in 7ms
gpu-app v0.1.0
└── torch v2.15.0

Windows gets torch v2.15.0+cu132 from PyTorch's index, and macOS gets PyPI's torch v2.15.0, which installed on the Mac. The commands work unchanged in PowerShell.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
A CUDA index for torch with no marker | This error on a Mac | marker = "sys_platform == 'win32'" |
Adding the marker to torch but not to torchvision | torchvision still points at the CUDA index everywhere | Give every PyTorch package the same entry |
Following the hint and adding tool.uv.required-environments | uv failed while resolving: your project's requirements are unsatisfiable | Use a marker |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Distribution `torch==…+cu132` can't be installed on a Mac | The CUDA index applies on macOS | Add the Windows marker |
FAQ
Why not use the CUDA index on Linux too?
You can, as uv's guide shows, but there's no need for CUDA 13.2: PyPI's Linux build already uses it, as PyTorch's install selector shows (pip3 install torch torchvision for Linux with CUDA 13.2).
What does the full setup with torchvision look like?
How to Install PyTorch with CUDA Using uv sets up both packages and checks every system.
Conclusion
A [tool.uv.sources] entry without a marker sent macOS to PyTorch's CUDA index, which has no macOS builds, so uv add torch failed with Distribution `torch==2.15.0+cu132` can't be installed. With marker = "sys_platform == 'win32'", Windows got torch v2.15.0+cu132 and the Mac got PyPI's torch v2.15.0.
Additional Resources
- Using uv with PyTorch — the PyTorch indexes and the markers that pick them.
- uv: platform-specific sources — markers in
[tool.uv.sources]. - PyTorch: Get Started — which index each system and CUDA version uses.
