Python is a programming language created by Guido Van Rossum in 1990. Currently, it has two versions, Python 2 and Python 3. In this tutorial, I will guide you to install Python 2 on Ubuntu!
First, let’s download Python 2, the latest version at:
https://www.python.org/downloads/source/
Currently, the latest version of Python 2 is 2.7.12 and its installation file is called Python-2.7.12.tgz.
After downloading, I put the Python-2.7.12.tgz file into the directory /home/khanh/Downloads, you can leave it anywhere.
OK, now let’s get started!
Open Ubuntu Terminal and navigate to /home/khanh/Downloads.
We will extract the previous Python-2.7.12.tgz file using the following command:
1 2 3 |
khanh@ubuntu:~$ cd /home/khanh/Downloads/ khanh@ubuntu:~/Downloads$ tar zxf Python-2.7.12.tgz khanh@ubuntu:~/Downloads$ |
A Python-2.7.12 directory will be created in /home/khanh/Downloads.
Please move to this folder with the following command:
1 2 |
khanh@ubuntu:~/Downloads$ cd Python-2.7.12/ khanh@ubuntu:~/Downloads/Python-2.7.12$ |
Then, do the following:
1 |
khanh@ubuntu:~/Downloads/Python-2.7.12$ ./configure |
1 |
khanh@ubuntu:~/Downloads/Python-2.7.12$ make |
1 |
khanh@ubuntu:~/Downloads/Python-2.7.12$ sudo make install |
Result: