Install Python 2.7 on Ubuntu 20.04 (OS standard?)

Introduction

Install Python 2.7 on Ubuntu 20.04

In 20.04 LTS, the python included in the base system is Python 3.8. Python 2.7 has been moved to universe and is not included by default in any new installs.

Remaining packages in Ubuntu which require Python 2.7 have been updated to use /usr/bin/python2 as their interpreter, and /usr/bin/python is not present by default on any new installs. On systems upgraded from previous releases, /usr/bin/python will continue to point to python2 for compatibility. Users who require /usr/bin/python for compatibility on newly-installed systems are encouraged to install the python-is-python3 package, for a /usr/bin/python pointing to python3 instead.

Source: FocalFossa / ReleaseNotes -Ubuntu Wiki

support

Maintenance period unknown. Will OS EOL be maintained?

LOG part 1

Installation

# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

# apt update; apt install -y python
...Abbreviation

Various confirmations

# which python{,2,3}
/usr/bin/python
/usr/bin/python2

# ll /usr/bin/python*
lrwxrwxrwx. 1 root root       7 Apr 15 10:45 /usr/bin/python -> python2*
lrwxrwxrwx. 1 root root       9 Mar 13 12:31 /usr/bin/python2 -> python2.7*
-rwxr-xr-x. 1 root root 3694632 Apr  7 12:05 /usr/bin/python2.7*

# python -V
Python 2.7.18rc1

# apt show python
Package: python
State: not a real package (virtual)
N: Can't select candidate version from package python as it has no candidate
N: Can't select versions from package 'python' as it is purely virtual
N: No packages found

# apt show python2
Package: python2
Version: 2.7.17-2ubuntu4
Priority: optional
Section: universe/python
Source: python-defaults
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Matthias Klose <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 139 kB
Provides: python-ctypes, python-email, python-importlib, python-profiler, python-wsgiref
Pre-Depends: python2-minimal (= 2.7.17-2ubuntu4)
Depends: python2.7 (>= 2.7.17~rc1-1~), libpython2-stdlib (= 2.7.17-2ubuntu4)
Suggests: python2-doc (= 2.7.17-2ubuntu4), python-tk (>= 2.7.17~rc1-1~)
Conflicts: python-central (<< 0.5.5)
Breaks: python (<< 2.7.15-2), update-manager-core (<< 0.200.5-2)
Replaces: python (<< 2.7.15-2), python-dev (<< 2.6.5-2)
Homepage: https://www.python.org/
Task: ubuntustudio-desktop-core, ubuntustudio-desktop
Download-Size: 26.5 kB
APT-Manual-Installed: no
APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: interactive high-level object-oriented language (Python2 version)

LOG part 2

Installation

# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

# apt update; apt install -y python2
...Abbreviation

Various confirmations

# which python{,2,3}
/usr/bin/python2

# ll /usr/bin/python*
lrwxrwxrwx. 1 root root       9 Mar 13 12:31 /usr/bin/python2 -> python2.7*
-rwxr-xr-x. 1 root root 3694632 Apr  7 12:05 /usr/bin/python2.7*

# python2 -V
Python 2.7.18rc1

# apt show python2
Package: python2
Version: 2.7.17-2ubuntu4
Priority: optional
Section: universe/python
Source: python-defaults
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Matthias Klose <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 139 kB
Provides: python-ctypes, python-email, python-importlib, python-profiler, python-wsgiref
Pre-Depends: python2-minimal (= 2.7.17-2ubuntu4)
Depends: python2.7 (>= 2.7.17~rc1-1~), libpython2-stdlib (= 2.7.17-2ubuntu4)
Suggests: python2-doc (= 2.7.17-2ubuntu4), python-tk (>= 2.7.17~rc1-1~)
Conflicts: python-central (<< 0.5.5)
Breaks: python (<< 2.7.15-2), update-manager-core (<< 0.200.5-2)
Replaces: python (<< 2.7.15-2), python-dev (<< 2.6.5-2)
Homepage: https://www.python.org/
Task: ubuntustudio-desktop-core, ubuntustudio-desktop
Download-Size: 26.5 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: interactive high-level object-oriented language (Python2 version)

Recommended Posts

Install Python 3.8 on Ubuntu 18.04 (OS standard)
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
Install Python 3.3 on Ubuntu 12.04
Install OpenCV on Ubuntu + python
Install confluent-kafka for Python on Ubuntu
Steps to install Python environment on Ubuntu
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
Install TensorFlow on Ubuntu
Install python on WSL
Install Python on Pidora.
Install Scrapy on python3
Install Python on Mac
Install PySide2 on Ubuntu
Install JModelica on Ubuntu
Install python on windows
Install Python 2.7.3 on CentOS 5.4
Install Theano on Ubuntu 12.04
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
Install Python 3.6 on Docker
Install python package in personal environment on Ubuntu
[Procedure memo] Install Python3 + OpenSSL locally on Ubuntu
Install MongoDB on Ubuntu 16.04 and operate via python
Set up Python 3.4 on Ubuntu
Install Python 3.8 on RHEL 8 (AppStream)
Use matplotlib on Ubuntu 12 & Python
Install watchdog on Windows + Python 3.3
Install pygame on python3.4 on mac
Install tomcat 9 on Cent OS 8
Put Python 3.x on Ubuntu
Install pandas 0.14 on python3.4 [on Mac]
Install GoLand IDE on Ubuntu
wsl Install PostgreSQL on Ubuntu 18.04
Python --Install MySQLDB on EC2
Install Caffe on Ubuntu 14.04 (GPU)
Install Python 3.8 on CentOS 8 (AppStream)
Install Docker on WSL Ubuntu 18.04
[Python] [Chainer] [Windows] Install Chainer on Windows
Install Bash on Ubuntu on Windows, Ruby, Python, Jupyter, etc.
Install CUDA10.1 + cuDNN7.6.5 + tensorflow-2.3.0 on Ubuntu 18.04
Install Python Pillow on Amazon Linux
Python 3.4 pyvenv fails on Ubuntu 14.04 LTS
Install Caffe on Ubuntu 14.04 (CPU mode)
Install Python3 on Sakura server (FreeBSD)
Install Mecab and mecab-python3 on Ubuntu 14.04
Install and run dropbox on Ubuntu 20.04
Install Adopt OpenJDK 11 on Cent OS 8
Install OpenCV and Chainer on Ubuntu
install python
Building a Python environment on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Preparing python using vscode on ubuntu
Install Pytorch on Blender 2.90 python on Windows
Install Python 3.7 Anaconda on MAC, but Python 2
Install Scipy on Mac OS Sierra
Install python3 and scientific calculation library on Ubuntu (virtualenv + pip)
Install python3 on Mac (El Capitan)
Install mitmproxy on Mac OS X
Install fabric on Ubuntu and try