Skip to content

Installing PyTorch: An index URL could not be queried #8344

@Leon0402

Description

@Leon0402

Setup is:

uv init
uv venv --python 3.10

Leading to the simple pyproject.toml:

[project]
name = "test2"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"

Trying to install torch with:

uv add torch torchvision torchaudio --default-index https://download.pytorch.org/whl/cu118

leads to the error:

error: Distribution `torchaudio==2.0.0 @ registry+https://download.pytorch.org/whl/cu118` can't be installed because it doesn't have a source distribution or wheel for the current platform

Alternatively using pip:

uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

leads to a different error:

⠋ lit==15.0.7                                                                                                                                                                     × Failed to download and build `lit==15.0.7`
  ├─▶ Failed to resolve requirements from `build-system.requires`
  ├─▶ No solution found when resolving: `setuptools>=40.8.0`, `wheel`
  ╰─▶ Because wheel was not found in the package registry and you require wheel, we can conclude that your requirements are unsatisfiable.

      hint: An index URL (https://download.pytorch.org/whl/cu118) could not be queried due to a lack of valid authentication credentials (403 Forbidden).

I am on a Linux System and use uv 0.4.24.

Using virtualenv and normal pip works fine, thus I suspect a problem with uv here.

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