Skip to content

uv add rejects pytorch from its index when on mac #5182

@baggiponte

Description

@baggiponte

I am trying to use uv to add torch to my project's dependencies, but it fails. I am on macOS14.4.1 (ARM).

Here is a minimal repro.

[project]
name = "test"
version = "0.1.0"
requires-python = ">=3.10"

Then run:

uv python pin 3.10
uv add --extra-index-url="https://download.pytorch.org/whl/cpu" -- torch

Error:

warning: `uv add` is experimental and may change without warning.
Using Python 3.10.14 interpreter at: /Users/luca/Library/Application Support/uv/python/cpython-3.10.14-macos-aarch64-none/install/bin/python3
Creating virtualenv at: .venv
Resolved 13 packages in 1.69s
error: distribution torch==2.3.1+cpu @ registry+https://download.pytorch.org/whl/cpu can't be installed because it doesn't have a source distribution or wheel for the current platform

If I use uv pip install then everything works smoothly:

uv pip install --extra-index-url="https://download.pytorch.org/whl/cpu" -- torch
Resolved 9 packages in 1.73s
Installed 9 packages in 369ms
 + filelock==3.13.1
 + fsspec==2024.2.0
 + jinja2==3.1.3
 + markupsafe==2.1.5
 + mpmath==1.3.0
 + networkx==3.2.1
 + sympy==1.12
 + torch==2.3.1
 + typing-extensions==4.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglockRelated to universal resolution and locking

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions