109

Having used Ubuntu 18.04 for a handful of years now, and reading that Python 2 has been removed from Ubuntu 20.04, I was looking forward to using the commands python or pip rather than python3 or pip3. So today I tried Ubuntu 20.04 for the first time, and found:

$ python --version

Command 'python' not found

$ python3 --version Python 3.8.5

I was surprised and upon looking into things further found the following about the package python-is-python3:

https://packages.ubuntu.com/focal/python-is-python3

https://launchpad.net/ubuntu/focal/+package/python-is-python3

How to make 'python' program command execute Python 3?

The middle of these 3 links is the most descriptive, but none are especially clear about what python-is-python3 is/does and the full scope of ramifications if sudo apt-get install python-is-python3 was to be ran on a Ubuntu 20.04 install.

Here are some questions I have about python-is-python3:

  1. Is python-is-python3 proprietary to Ubuntu/Canonical? If so, do other Linux distributions use python-is-python3 also or do some other distributions have a similar equivalent?

  2. I gather if I was to run python-is-python3 from the command prompt then I could use the command python instead of python3. First can somebody confirm this, and second, does the same go for pip, i.e. pip instead of pip3?

  3. The launchpad.net link above mentions creation of a symlink. Does python-is-python3 really just create a single symlink? It seems odd to introduce a package for such a bare bones purpose. Also, if this package is subsequently uninstalled (i.e. sudo apt --purge remove python-is-python3) does this remove the symlink?

  4. Are there any commonly used Python 2 packages out there anymore? I can't think of any offhand.

  5. Has anybody ran python-is-python3 and then later regretted doing so due to a reason that was not realized ahead of time?

  6. It seems the benefit of running python-is-python3 would be not having to add the 3 at the end of Python commands, but the disadvantage is that you would then have a non-standard Ubuntu setup, is this a fair summary of the python-is-python3 benefit/drawback?

cdahms
  • 1,773
  • 6
  • No. 2) Yes. No. 3) Yes. Yes. 4) No. 5) Impossible to know with certainty, since we don't allow rants or reviews here. 6) Yes.
  • – user535733 Dec 02 '20 at 02:22
  • "do some other distributions have a similar equivalent?" - RHEL8 did something similar, and broke everything that had a shebang of #!/usr/bin/env python. Manjaro, which I use these days, seemed to handle the switch from Python 2 to 3 more smoothly. – Aaron F Dec 02 '20 at 12:35