Repository navigation
make install should symlink bin/python to bin/python3 #102358
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancement
on Mar 1, 2023 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?Reacted by AvasamI 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.
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
pythonbe 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
pythonas Python 2 by default. (Definition of "relevant" left as an exercise for the reader.)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?)
It is unclear to me whether this issue is "awaiting a PR" (that adds a
pythonsymlink tomake 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.
- addedbuildThe build process and cross-buildThe build process and cross-build
on Nov 27, 2023
Feature or enhancement
When you build and
make installCPython from source, currently the installedbin/directory containspython3(symlinked topython3.XX), but it does not containpython. This issue proposes that it should also contain apythonsymlink.Pitch
Windows installs (from python.org) do not contain a
python3executable, so there is currently no form that documentation examples can take that will work for all platforms reliably.#99185 has more discussion of
pythonvspython3from the Windows perspective.Venv
bin/dir does contain apython -> python3symlink.PEP 394 recommends
pythonoverpython3as the canonical way to invoke Python.The conclusion in #98761 was that
python -m ...should be preferred overpython3 -m ...in documentation examples.Of course, most users will not be building and
make installing their own Python. But if our recommendation to redistributors is to providepython -> python3, would it not be best to model that ourselves inmake install? Is there any downside?