Skip to content

Prefer python in a later PATH entry over pythonX.Y in an earlier entry  #6444

Open
@zanieb

Description

@zanieb

Originally discussed at #6348 (comment)

While I don't think it's necessary for the documentation to give every detail of the discovery process, this presumes that discovery is intuitive - and IMO, defaulting to an older version of Python when there's no python command on the PATH (and hence no "default Python" at the command line) is not intuitive. I don't think the existence of python3.x on PATH should ever influence the decision on what the default Python version should be - by having an explicit version in the executable name, it's by definition not used as a default...

I think the problem is we look for all valid Python executable names on the PATH one directory at a time. Instead, pythonX.Y should only be used if we can't find any Python executable on the PATH with the name python or python3 or if you specifically request --python X.Y. This will be a little tricky to do in a performant manner, i.e., we don't want to list and parse the members of the directories on the PATH repeatedly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingA breaking changebugSomething isn't workinguv pythonRelated to the uv python interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions