Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv add --index fails to install PyTorch CUDA packages on Windows #11532

Open
AbyssSkb opened this issue Feb 15, 2025 · 1 comment
Open

uv add --index fails to install PyTorch CUDA packages on Windows #11532

AbyssSkb opened this issue Feb 15, 2025 · 1 comment
Labels
question Asking for clarification or support

Comments

@AbyssSkb
Copy link

Question

Is there a way to directly install the CUDA version of PyTorch via the command line on Windows and support project dependency management with uv?

I tried installing PyTorch using uv add torch --index on my computer, but it ultimately failed. The documentation doesn't seem to mention this. Why does uv add torch --index fail to install PyTorch?

Although I can install PyTorch by modifying the pyproject.toml file as mentioned in the documentation, I want to know if it is possible to install it directly through the command line (which is simpler and more familiar).

> uv add torch --index https://download.pytorch.org/whl/cu126
Resolved 16 packages in 4.52s
error: Distribution `markupsafe==3.0.2 @ registry+https://download.pytorch.org/whl/cu126` can't be installed because it doesn't have a source distribution or wheel for the current platform

hint: You're using CPython 3.10 (`cp310`), but `markupsafe` (v3.0.2) only has wheels with the following Python implementation tag: `cp313`

Platform

Windows 11 x86_64

Version

uv 0.6.0 (591f38c 2025-02-14)

@AbyssSkb AbyssSkb added the question Asking for clarification or support label Feb 15, 2025
@charliermarsh
Copy link
Member

charliermarsh commented Feb 15, 2025

Unfortunately I don't think there's a way to avoid this right now due to how the PyTorch index is structured... They have a markupsafe wheel, but only for Linux. By default, if we see a package (like markupsafe) on an index that the user provided (like the PyTorch index), we avoid looking at other indexes for the same package, as a security concern.

If we supported a --constraints flag here, you could do --constraints markupsafe<3.0.2, but even that isn't great. Hmm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

2 participants