> for the time being, all distributions should ensure that python refers to the same target as python2.
[0] https://www.debian.org/doc/packaging-manuals/python-policy/c... [1] https://blueprints.launchpad.net/ubuntu/+spec/core-1311-pyth... [2] https://www.python.org/dev/peps/pep-0394/
edit: seems to be the case[0]
> however, end users should be aware that python refers to python3 on at least Arch Linux (that change is what prompted the creation of this PEP), so python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3.
sed -i s/python/python3/ /all/the/thingsThis is Canonical's stance:
> All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only.
Regardless, nowadays many people deploy Python applications as stand-alone bundles. We're happily running Python 3.5 on CentOS 6 and it took like ten minutes to deploy (pyenv!). This lets us use a rock-solid base system with an up-to-date application stack, which makes our old school admins happy.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
$python3 --version
Python 3.5.2
Edit: Just to check I started a clean 16.04 (on DO) and did the commands: # lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
# python --version
The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: apt install <selected package>
# python3 --version
Python 3.5.2
So, no python 2 by default but python 3 and you call it using "python3" as adviced in the pep qznc talks about."for the time being, all distributions should ensure that python refers to the same target as python2."
I read above as the python community itself made "python" the default for python 2.7 and "python3" for python 3.x. Nevertheless, an unfortunate choice at this time. I understand the reasoning at the time of writing (March 2011) but now this should be reconsidered.
[1] https://www.python.org/dev/peps/pep-0394/Say, you use containers and so your application is isolated from the host system. When the next version of your host system comes with a new version of Docker, you have to do similar testing and validation anyway.
If I was writing software that had to be used in as many places as possible or sold, I'd absolutely strongly consider using 2.7.
I understand the desire to have stable releases. But... if you're not shipping the most recent stable version of something, and instead shipping something that's 4-5 years old... it's frustrating for users and developers alike.
That's why Python 2.7 will be around and maintain dominance for a while.
When the latest stable releases of the primary environments are defaulting to something you have to have very good reasons why not to use the default (even when it's easy to change the default).
Administrators (in the old school not the new "everything in containers") don't like using non-defaults.