The `python-is-python2` package on Ubuntu Focal Fossa

I did a fresh install of Ubuntu 20.04 Focal Fossa on my laptop, and was surprised at what happened when I went to install python:

$ sudo apt install python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'

Um, what?

It turns out that since the python package has historically been Python 2, and there’s a separate python3 package (and the commands match the package names, also pip3 etc), that default has remained in an attempt to break things for fewer people. Which is nice, but how do I get current, stable python?

sudo apt install python-is-python3

There’s a sister package called python-is-python3 and installing that makes my python command use version 3 as I expected! It’s a fairly good solution to the problem but it took me a moment to work out how to install it so I thought I’d write it down for next time! Hope it helps you too :)


Also published on Medium.

2 thoughts on “The `python-is-python2` package on Ubuntu Focal Fossa

  1. Thanks !

    Upgrading debian 10 to 11 removed A LOT of things about python, so nagios was not working anymore

    Installed python-is-python-3 and all works

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.