-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
uv sync
: Distribution markupsafe==3.0.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
#9647
Comments
To confirm, I can reproduce this
The lock entry is [[package]]
name = "markupsafe"
version = "3.0.2"
source = { registry = "https://download.pytorch.org/whl/cpu" }
wheels = [
{ url = "https://download.pytorch.org/whl/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396" },
] |
@charliermarsh looks like the universal resolver to account for wheels on additional indexes? |
@jfaust I think the recommendation here would be to use the new https://docs.astral.sh/uv/guides/integration/pytorch/ |
@zanieb Got it, that's much nicer. I'm brand new to Should I close this, or would you still expect the original to have worked? |
We should at least have a better error message for the original. |
I'm starting to think about this problem. |
Hello, I am also having a similar problem. When following the guide on how to use error: Distribution `torch==2.5.1 @ 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 I am pretty sure this worked before so I don't really know what have changed. I have also tried to set a marker specifically for linux but still get the issue. [tool.uv.sources]
torch = [
{ index = "pytorch-cpu", marker = "platform_system == 'Linux'" },
]
torchvision = [
{ index = "pytorch-cpu", marker = "platform_system == 'Linux'" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true |
Hello, I also encountered the same issue. I would be grateful if measures could be taken. For now, I was able to resolve the issue by fixing it to "markupsafe==2.1.3" as shown in the following file, so I will share it. [project]
name = "test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"numpy>=2.1.2",
"torch>=2.5.1",
]
[project.optional-dependencies]
rocm = [
"torch>=2.1.0",
"torchvision>=0.20.0",
"markupsafe==2.1.3",
]
[tool.uv.sources]
torch = [
{ index = "torch-rocm", extra = "rocm" },
]
[[tool.uv.index]]
name = "torch-rocm"
url = "https://download.pytorch.org/whl/rocm6.2" |
Yes, when I tried downgrading to markupsafe==2.1.5 and markupsafe==2.1.3, the error disappeared. (test) root@DESKTOP:~/test# uv add torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --extra-index-url https://download.pytorch.org/whl/cpu
warning: Indexes specified via `--extra-index-url` will not be persisted to the `pyproject.toml` file; use `--index` instead.
Resolved 18 packages in 2.67s
error: Distribution `markupsafe==3.0.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
hint: You're using CPython 3.11 (`cp311`), but `markupsafe` (v3.0.2) only has wheels with the following Python implementation tag: `cp313`
(test) root@DESKTOP:~/test# uv add markupsafe==2.1.3
Resolved 2 packages in 119ms
Prepared 1 package in 152ms
Uninstalled 1 package in 0.90ms
Installed 1 package in 25ms
- markupsafe==2.1.5
+ markupsafe==2.1.3
(test) root@DESKTOP:~/test# uv add torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --extra-index-url https://download.pytorch.org/whl/cpu
warning: Indexes specified via `--extra-index-url` will not be persisted to the `pyproject.toml` file; use `--index` instead.
Resolved 18 packages in 2.58s
Audited 13 packages in 0.01ms |
Edit: Seems like I've misunderstood the current issue's topic and posted something about a different issue. But I still think this could be added as a new feature to make adding explicit indexes easier. Sorry 😓 I've noticed something and maybe there could a solution to this problem without downgrading. I've noticed when i run [project]
name = "test3"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"torch",
"torchvision",
]
[tool.uv.sources]
torch = { index = "pytorch-cu124" }
torchvision = { index = "pytorch-cu124" }
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124" And after which i get the error and hence the content is rolled back and dependencies and indexes are removed. So, what I did was paste the above content into the pyproject manually, add
Proposal: Add a |
Similar to #8922, but with
uv sync
. With the following pyproject.toml:I get:
If I add
https://pypi.org/simple
to the beginning of theextra-index-url
list, the problem goes away.The text was updated successfully, but these errors were encountered: