Skip to content

Package resolution should retry with no cache if a requested version is not found #16281

@MaddyGuthridge

Description

@MaddyGuthridge

Summary

I manage developer tools using the wonderful mise, which uses uv under the hood to manage Python tools.

I have found that when upgrading some tools, mise will have a newer cache than uv, causing uv to refuse to install recent package releases, claiming that these packages do not exist (despite the fact that they do).

I opened a discussion where a project contributor stated that it was best to resolve this issue upstream.

To reproduce

  1. Publish a new version of some package
  2. uv tool install package==[new version]

Actual output

uv fails despite the version being available on pypi.

$ uv tool install markten==1.3.1 -v
DEBUG uv 0.9.2
DEBUG Acquired shared lock for `/home/maddy/.cache/uv`
DEBUG Searching for default Python interpreter in managed installations or search path
DEBUG Searching for managed installations at `/home/maddy/.local/share/uv/python`
DEBUG Found `cpython-3.13.7-linux-x86_64-gnu` at `/home/maddy/bin/python` (first executable in the search path)
DEBUG Acquired lock for `/home/maddy/.local/share/uv/tools`
DEBUG Checking for Python environment at: `/home/maddy/.local/share/uv/tools/markten`
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.13.7
DEBUG Solving with target Python version: >=3.13.7
DEBUG Adding direct dependency: markten>=1.3.1, <1.3.1+
DEBUG Found fresh response for: https://pypi.org/simple/markten/
DEBUG Searching for a compatible version of markten (>=1.3.1, <1.3.1+)
DEBUG No compatible version found for: markten
  × No solution found when resolving dependencies:
  ╰─▶ Because there is no version of markten==1.3.1 and you require markten==1.3.1, we can conclude that your requirements are unsatisfiable.
DEBUG Released lock at `/home/maddy/.local/share/uv/tools/.lock`
DEBUG Released lock at `/home/maddy/.cache/uv/.lock`

Or worse, when I use Mise:

$ mise upgrade --debug
DEBUG ARGS: /home/maddy/.local/bin/mise upgrade --debug
DEBUG config: ~/.config/mise/config.toml
INFO  mise 2025.10.6 by @jdx              upgrade
DEBUG install_some_versions: pipx:markten@1.3
INFO  pipx:markten@1.3.1                  install
INFO  pipx:markten@1.3.1                  uv tool install markten==1.3.1
DEBUG Converted registry URL to index URL: https://pypi.org/simple
DEBUG $ uv tool install markten==1.3.1
  × No solution found when resolving dependencies:
  ╰─▶ Because there is no version of markten==1.3.1 and you require
      markten==1.3.1, we can conclude that your requirements are
      unsatisfiable.
      hint: `markten` was found on https://pypi.org/simple, but not at
      the requested version (markten==1.3.1). A compatible version may be
      available on a subsequent index (e.g., https://pypi.org/simple). By
      default, uv will only consider versions that are published on the first
      index that contains a given package, to avoid dependency confusion
      attacks. If all indexes are equally trusted, use `--index-strategy
      unsafe-best-match` to consider all versions from all indexes, regardless
      of the order in which they were defined.
ERROR uv failed
DEBUG config: ~/.config/mise/config.toml
Error:
   0: Failed to install pipx:markten@1.3:
         0: uv exited with non-zero status: exit code 1

      Location:
         src/cmd.rs:488

      Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
      Run with RUST_BACKTRACE=full to include source snippets.

Location:
   src/toolset/mod.rs:264

Version:
   2025.10.6 linux-x64 (2025-10-08)

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Expected output

Upon realising that the version of the dependency doesn't exist in its cache, uv should retry, skipping its cache.

Workarounds

Manually skip the cache using UV_NO_CACHE=1 as an environment variable

Platform

Linux 6.16.10-200.fc42.x86_64 x86_64 GNU/Linux

Version

uv 0.9.2

Python version

Python 3.11.13

Metadata

Metadata

Assignees

No one assigned

    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