How to Install Python on Linux / Ubuntu ?

If you have just now started looking into python, the first thing you need to do is install python on your development machine. If you are working on Windows, please check our another post “How to install Python on Windows”

This post helps you to install python on Ubuntu.

Installation of Python 2

To install default python version in your current Ubuntu distribution, just type below command,

$ sudo apt-get install python 

Once thats installed successfully, you can check where python is installed on your machine as,

$ which python
/usr/bin/python

And the version of Python can be checked as,

$ python --version
Python 2.7.17

We had installed Python in Ubuntu 18.04, where default python version installed is 2.7.17. In your Ubuntu you may see different version.

Related :   How to change python version in Ubuntu ?

As seen in above the default python installation installs Python 2.

Installation of Python 3

Python 3 can be installed as,

$ sudo apt-get install python3
 $ which python3
/usr/bin/python3
$ python3 --version
Python 3.6.9

Installing latest Python Version

You can check the latest python version available from https://www.python.org/downloads/ . As of today the latest python version was 3.8 hence to install this latest python version, follow below steps,

$ sudo apt-get install software-properties-common 
$ sudo add-apt-repository ppa:deadsnakes/ppa 
$ sudo apt-get update 
$ sudo apt-get install python3.8 

lynxbee_ezoic

Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded