How To Install Python 3.6 on Linux Using Terminal Interface

Introduction

In this article I am going to explain how to install Python 3.6 on Linux using terminal interface. But, before we proceed first lets see what is Python and what is use of Python.

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, makes it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together.

Python is simple and easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse.

The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.

To install Python 3.6 on Linux

  • Check to see if Python is already installed on your system:
    $ python --version

If Python is not installed, install Python with your distribution’s package manager. The command and package name varies:

  • On Debian derivatives such as Ubuntu, use APT:
    $ sudo apt-get install python3
  • On Red Hat and derivatives, use yum:
    $ sudo yum install python
  • On SUSE and derivatives, use zypper:
    $ sudo zypper install python3

Install python 3.6 on Linux (Ubuntu 18.04)

Before we proceed first lets update old repositories to its current version.

Open the Terminal and execute the command “sudo apt-get update

[email protected]:~$ sudo apt-get update *// Starting repositories update //*
[sudo] password for umesh: 
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [117 kB]     
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                     
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [108 kB]    
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [116 kB]  
Fetched 341 kB in 4s (152 kB/s)    
Reading package lists... Done *// Updating repositories finished //*

To Install Python 3.6 On Linux Download The Package

If you have not download Python yet then download latest version of Python 3.6.5 package, Click here to download the Package.

How To Install Python 3.6 on Linux Using Terminal Interface
Install Python 3.6 on Linux

Once download gets complete follow the steps to proceed further. You can verify this using terminal or graphical way.

[email protected]:~$ cd Downloads/
[email protected]:~/Downloads$ ls
Python-3.6.5.tar.xz   *// Downloaded Python 3.6.5 package name //*

Installing Python 3.6.5 package

To proceed with installation first we have to extract the downloaded package by executing following command on terminal window.

[email protected]:~/Downloads$ tar -xvf Python-3.6.5.tar.xz   *// Extracting the downloaded package //*
Output:
[email protected]:~/Downloads$ ls
Python-3.6.5 Python-3.6.5.tar.xz *// File successfully extracted //*

As you can see in above package is extracted successfully. Let’s move on script configuration

Recommended for you: How To Use Or What Is The Use Of .Bashrc File In Linux

Configuring Python 3.6.5 Script

Open the Python-3.6.5 directory (extracted file) and use “configure” command to configure it.

[email protected]:~/Downloads$ cd Python-3.6.5/
[email protected]:~/Downloads/Python-3.6.5$ ls
aclocal.m4    Doc         LICENSE          Objects   pyconfig.h.in
config.guess  Grammar     Mac              Parser    Python
config.sub    Include     Makefile.pre.in  PC        README
configure     install-sh  Misc             PCbuild   setup.py
configure.ac  Lib         Modules          Programs  Tools
[email protected]:~/Downloads/Python-3.6.5$ ./configure

Now you have successfully completed the script configuration.

Completing Python 3.6.5 Installation

To complete the installation process we will use following commands:

  • sudo make
  • sudo make install
[email protected]:~/Downloads/Python-3.6.5$ sudo make
[email protected]:~/Downloads/Python-3.6.5$ sudo make install *// Final command //*

We have successfully installed the Python 3.6.5 package on Ubuntu 17.10. Open a command prompt or shell and run the following command to verify that Python installed correctly:

$ python3 --version Python 3.6.5

This is how we can install python 3.6 on Linux. If you found this tutorial helpful then Like and Share. If you got something else then feel free to comment.

This Post Has 2 Comments

  1. /home/adicchobe/Pictures/Screenshot from 2018-05-31 17-24-46.png
    this is coming at my screen after i do the “sudo make install”
    it is not being installed

    1. Hi Aditya,

      Thank you writing,

      Please copy paste the error code for better understanding.

Leave a Reply

Close