Loading Page

The Python 2 version is no longer a default Python version since Ubuntu 18.04. With a release of Ubuntu 20.04 the Python 2 on a default system installation has been also completely dropped hence you might encounter the following error when executing the python command:

Command 'python' not found

No despair, the Python 2 is not installed by default but it is still available for installation.

In this tutorial you will learn:
  • How to install Python 2
  • How to switch Python 2 as a default python interpreter
Software Requirements and Conventions Used
Category Description
System Requirements, Conventions or Software Version Used
Software Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
Other Python2/Python3
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Install Python 2 on Ubuntu 20.04 step by step instructions

  1. To install Python 2 version on Ubuntu 20.04 open a terminal and enter one of the following commands:

    $ sudo apt install python2
    OR
    $ sudo apt install python-minimal
  2. Check your current Python version:

    $ python2 -V
    Python 2.7.17
  3. Follow our tutorial on how to switch to Python 2 from Python 3 as a default version on Ubuntu 20.04.

You Might Also Like

Comments