How to Install Python on Ubuntu 16.04

r00t October 10, 2017

Install Python on Ubuntu 16.04

In this tutorial we’ll learn how to install Python on Ubuntu 16.04. We will also install and configure its prerequisites. Python are of the most popular new generation programming languages software dynamically typed scripting languages ​​with strong support for object-oriented software architecture and implementation is very different from the kings of programming languages ​​such as Java and C, none of the new languages ​​have a strict syntax and hierarchy and instead focus on helping developers to “do something quickly,” instead of having to worry about missing a semicolon or closing parenthesis.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 16.04 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Python on Ubuntu 16.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing Python.

First, run command to add the PPA:

sudo add-apt-repository ppa:jonathonf/python-3.6

Then check updates and install Python 3.6 via commands:

sudo apt-get update
sudo apt-get install python3.6

To make python3 use the new installed python 3.6 instead of the default 3.5 release, run following two commands:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

Finally switch between the two python versions for python3 via command:

sudo update-alternatives --config python3

Congratulation’s! You have successfully install and configure Python on your Ubuntu 16.04 server. Thanks for using this tutorial for installing Python programming language on Ubuntu system.

The Tags:

Leave a Comment

Comments are closed.