Skip to content

uv suggests incorrect install command when Python downloads are set to manual and version request is a range #17051

@cls-oi

Description

@cls-oi

Summary

As of #14522, uv prints the following hint when Python downloads are set to 'manual' and the version request is a range:

A managed Python download is available for >=3.13, <3.14, but Python downloads are set to 'manual', use `uv python install >=3.13, <3.14` to install the required version

Of course, if we go ahead and run the suggested command:

$ uv python install >=3.13, <3.14
-bash: 3.14: No such file or directory
$ rm '=3.13,'
$

I think that's because here:

PythonDownloads::Manual => {
return Err(err.with_missing_python_hint(format!(
"A managed Python download is available{for_request}, but Python downloads are set to 'manual', use `uv python install {}` to install the required version",
request.to_canonical_string(),
)));

... request is a PythonRequest::Version(VersionRequest::Range(...)), in which case maybe it should be quoted.

Platform

Windows 11 x86_64

Version

uv 0.9.7

Python version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingerror messagesMessaging when something goes wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions