Skip to content

py list doesn't show the executable path #86

Closed

Description

@pfmoore

Is your feature request related to a problem? Please describe.
One thing I often need to know is the executable name of the Python interpreter (although to be fair, with the new pythonX.Y aliases, that need might not be as great any more). It would be nice if this was part of the default output of py list.

Describe the solution you'd like
Add the executable path (or sys.prefix, it's not critical which) to the default display of py list.

Describe alternatives you've considered
Given that there's limited screen space, removing the "aliases" column in favour of "executable" might be worthwhile. The aliases are fairly easy to deduce from the version, so seem less helpful to have available by default.

It's possible to get the data via py list --format=json | jq, but the schema is rather complex (and undocumented?) and jq isn't the easiest language to use.

Activity

  1. pfmoore commented on May 9, 2025

    @pfmoore
    MemberAuthor

    Actually, I just found --format=prefix. This addresses at last part of my request. My confusion arose because the "Some columns were truncated" message in a plain py list command mentions JSON format, but nothing else. I'm not convinced the JSON suggestion is of much use there, as py list --format=json is hardly a good way of seeing the remainder of the truncated "alias" column.

    Maybe just say "Some columns were truncated. See py list --help for information on other ways to display this data." The key thing being to direct people to the actual help information rather than trying to guess what would be useful to them.

  2. pfmoore commented on May 10, 2025

    @pfmoore
    MemberAuthor

    I'd still prefer it if the executable path (or prefix) were displayed rather than the list of aliases in the default output. Should this issue be reopened to cover that, or should I take the fact that you've closed it as meaning that you disagree and have rejected the suggestion? (It's not a major matter to me, so I'm more interested in getting a clear resolution than insisting that this needs to be done).

  3. zooba commented on May 11, 2025

    @zooba
    Member

    I'd still prefer it if the executable path (or prefix) were displayed rather than the list of aliases in the default output

    I think consider it gently rejected. Using the full path ought to be rare, and the aliases are intentionally preferred (to try and match how POSIX systems work, so that docs can be compatible).

    For CPython (anything with a recent enough python3.dll anyway) the aliases will just load and run it directly, so they aren't doing an extra subprocess like the current venv redirector does - there's no loss in launching them compared to the "original" executable. But if possible I do want to try and move Windows users to think about either py -V:... or (to match POSIX) pythonX.Y. Everything in between is to smooth out muscle memory.

  4. added a commit that references this issue on May 12, 2025
    321a9e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions