PREV NEXT
Python Installation on UBUNTU & Linux:
Installation of Python2.7.15
In this article, we are going to learn how to install python 2.7.15 and Python 3.7.0
Python Installations:
Before going to start Python installation, please don’t forget to run below commands.
- $ sudo apt-get update
- $ sudo apt-get install build-essential checkinstall
Download Python 2.7.15
Download python from official website by using wget command on terminal.
- $ cd /usr/src
- $ sudo wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
- Extract the tar file by using below command
- $ sudo tar –xvzf Python-2.7.15.tgz
Then, it will extract the folder name with Python-2.7.15.
Compile and Install the source code:
Note:
if you don’t want to replace the default python library /usr/bin/python, then run following command “$ sudo make altinstall” instead of “$ sudo make install”
- $ cd Python-2.7.15
- $ sudo ./configure –enable-optimizations
- $ sudo make or sudo make all
- $ sudo make install (Read Note)
Verify the Install Version by Using below command:
- $ python2.7 –V
- Python 2.7.15
Installation of Python3.7.0
Python Installations:
Before going to start Python installation, please don’t forget to run below commands.
- $ sudo apt-get update
- $ sudo apt-get install build-essential checkinstall
Download Python 3.7.0
Download python from official website by using wget command on terminal.
- $ cd /usr/src
- $ sudo wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
- Extract the tar file by using below command
- $ sudo tar –xvzf Python-3.7.0.tgz
Then, it will extract the folder name with Python-3.7.0
Compile and Install the source code:
Note:
if you don’t want to replace the default python library /usr/bin/python, then run following command “$ sudo make altinstall” instead of $ sudo make install
- $ cd Python-3.7.0
- $ sudo ./configure –enable-optimizations
- $ sudo make or sudo make all
- $ sudo make install (Read Note)
Verify the Installed Version by Using below command:
- $ python3.7 –V
- Python 3.7.0