35

What's the default Python 3 version in the new Ubuntu 20.04? Is it still 3.6 or the latest Python 3.8?

I'm developing a Python program that I later want to run on the new Ubuntu 20.04. I'm unsure if I can use the latest Python 3.8 syntax. I don't have Ubuntu 20.04 installed yet to quickly check it, and I couldn't easily find the answer to this question on Google.

karel
  • 114,770
stefanbschneider
  • 493
  • 1
  • 5
  • 9

4 Answers4

35

Ubuntu 20.04 has Python 3.8.2 as the default version. Python 2.7 has been moved to universe and is not included by default in any new installs. Official Release Notes about Python

D. S.
  • 3
Tylore
  • 510
12

If you want to find the default Python 3 version of any Ubuntu release, you can run the command

rmadison python3
 python3 | 3.2.3-0ubuntu1   | precise         | all
 python3 | 3.2.3-0ubuntu1.2 | precise-updates | amd64, armel, armhf, i386, powerpc
 python3 | 3.4.0-0ubuntu2   | trusty          | amd64, arm64, armhf, i386, powerpc, ppc64el
 python3 | 3.5.1-3          | xenial          | amd64, arm64, armhf, i386, powerpc, ppc64el, s390x
 python3 | 3.6.5-3          | bionic          | amd64, arm64, armhf, i386, ppc64el, s390x
 python3 | 3.6.7-1~18.04    | bionic-updates  | amd64, arm64, armhf, i386, ppc64el, s390x
 python3 | 3.8.2-0ubuntu2   | focal           | amd64, arm64, armhf, i386, ppc64el, riscv64, s390x
 python3 | 3.8.6-0ubuntu1   | groovy          | amd64, arm64, armhf, i386, ppc64el, riscv64, s390x

Alternatively, check the package

https://packages.ubuntu.com/search?keywords=python3&searchon=names&exact=1&suite=all&section=all

For groovy (Ubuntu 20.10), it's Python 3.8.6:

enter image description here

  • 2
    A faster way of doing the same thing is to run the following command in a terminal: rmadison python3. In Ubuntu 20.04 it returns python3 | 3.8.2-0ubuntu2 – karel Oct 12 '20 at 11:31
  • 1
    This link is now working better for me: https://packages.ubuntu.com/search?keywords=python3&searchon=names&exact=1&suite=all§ion=all – Silveri Aug 24 '23 at 09:43
4

According to the Ubuntu 20.04 release notes:

Ubuntu 20.04 LTS comes with a refreshed state-of-the-art toolchain including new upstream releases of glibc 2.31, OpenJDK 11, rustc 1.41, GCC 9.3, Python 3.8.2, ruby 2.7.0, php 7.4, perl 5.30 and golang 1.13.

karel
  • 114,770
4

Manifest file

Another thing you can do for any Ubuntu version and any package is to check the manifest file which lists all preinstalled packages in the image: https://web.archive.org/web/20200508223720/https://releases.ubuntu.com/20.04/ubuntu-20.04-desktop-amd64.manifest

It contains python3.8 but nothing that seems python2 related.

See also: How do I list the default installed packages?

  • The link to the manifest is dead, https://releases.ubuntu.com/focal/ubuntu-20.04.1-desktop-amd64.manifest works. – Suzana Sep 21 '20 at 10:28