Skip to content

uv 0.5.21 fails to install pytorch #10772

@kasperipalkama

Description

@kasperipalkama

I have configured pytorch installation in pyproject toml in the following way:

[project.optional-dependencies]
cpu = [
  "torch==2.2.2",
]
cu118 = [
  "torch==2.2.2",
]

[tool.uv]
required-version = "0.5.21"
conflicts = [
  [
    { extra = "cpu" },
    { extra = "cu118" },
  ],
]
package = true
python-preference = "only-managed"

[tool.uv.sources]
torch = [
  { index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" },
  { index = "pytorch-cu118", extra = "cu118", marker = "platform_system != 'Darwin'" },
]

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[[tool.uv.index]]
name = "pytorch-cu118"
url = "https://download.pytorch.org/whl/cu118"
explicit = true

I'm on

{'NAME': 'Debian GNU/Linux', 'ID': 'debian', 'PRETTY_NAME': 'Debian GNU/Linux 11 (bullseye)', 'VERSION_ID': '11', 'VERSION': '11 (bullseye)', 'VERSION_CODENAME': 'bullseye', 'HOME_URL': 'https://www.debian.org/', 'SUPPORT_URL': 'https://www.debian.org/support', 'BUG_REPORT_URL': 'https://bugs.debian.org/'

machine

If I do a fresh installation without having a lock file locally by running uv sync --extra=cpu, it fails with:

error: Distribution `torch==2.2.2 @ 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions