Skip to content

make install should symlink bin/python to bin/python3 #102358

Description

@carljm

Feature or enhancement

When you build and make install CPython from source, currently the installed bin/ directory contains python3 (symlinked to python3.XX), but it does not contain python. This issue proposes that it should also contain a python symlink.

Pitch

Windows installs (from python.org) do not contain a python3 executable, so there is currently no form that documentation examples can take that will work for all platforms reliably.

#99185 has more discussion of python vs python3 from the Windows perspective.

Venv bin/ dir does contain a python -> python3 symlink.

PEP 394 recommends python over python3 as the canonical way to invoke Python.

The conclusion in #98761 was that python -m ... should be preferred over python3 -m ... in documentation examples.

Of course, most users will not be building and make install ing their own Python. But if our recommendation to redistributors is to provide python -> python3, would it not be best to model that ourselves in make install? Is there any downside?

Activity

  1. carljm commented on Mar 1, 2023

    @carljm
    MemberAuthor

    I guess the downside could be that anyone who is installing a Python 2 and a Python 3 to the same prefix, up til now, would have had python -> python2, and after this change they'd have a potential name collision. So the question is, are we enough beyond caring about Python 2 at this point that this is no longer a compelling reason?

  2. terryjreedy commented on Mar 1, 2023

    @terryjreedy
    Member

    I agree with the desire for a cross-platform startup command. However, macOS 10 (Catalina) still has 'python' linked to python2. Startup message says that 'future' versions of macOS would not have python2, so use 'python3'. Should not scripts that try to start python2 with 'python' fail rather than silently run python3. I believe that we have considered the presence and meaning of a 'python' link to be a matter for each distribution. Not sure we are ready to change this.

  3. carljm commented on Mar 2, 2023

    @carljm
    MemberAuthor

    I think the current (revised) PEP 394 is clear that we are beyond just "letting it be a matter for each distribution" to decide -- we are now already making a clear recommendation of what distributions should do. (They should make python be Python 3.)

    But the fact that Catalina didn't get there yet is meaningful. It seems OK to hold off on this change until there are no (relevant) platforms that still have python as Python 2 by default. (Definition of "relevant" left as an exercise for the reader.)

  4. carljm commented on Mar 2, 2023

    @carljm
    MemberAuthor

    we are now already making a clear recommendation of what distributions should do

    Actually, after a re-read of the full current state of PEP 394, it isn't at all clear that we've made that shift yet. (Though it seems like we might be feeling ready to do so soon?)

  5. itamaro commented on Aug 20, 2023

    @itamaro
    Contributor

    It is unclear to me whether this issue is "awaiting a PR" (that adds a python symlink to make install), or pending further discussion about whether such a symlink should be added.

    While it seems that the "python" over "python3" has won the docs discussion, it is also clear that neither is universally consistent across platforms. I am unsure if universal consistency has any relevance to the "to symlink or not to symlink" question.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions