Thursday, December 3, 2020

How to Install Python 3 on Ubuntu 20.04 Linux

Must read

How to Setup a Firewall with UFW on Debian 10 Linux

Nowadays, a Firewall is an essential utility and property of any system for security; by default Debian Operating system having a firewall...

How to Install Eclipse IDE on Debian 10 Linux

Eclipse is the most famous and widely used Java integrated development environment (IDE). It supports many plugins to enhance the capabilities to...

How to Install Ruby on Debian 10 Linux

Nowadays, Ruby is the most popular language, especially for SaaS application development. It has a perfect and elegant syntax structure, and it...

How to Install MongoDB on Debian 9 Linux

MongoDB is an open-source and free NoSQL document based database system. Nowadays, it is prevalent as most application developers are using MongoDB,...
SATISH KUMAR
I am Satish Kumar, Founder of LinuxConcept. Linux and F.O.S.S enthusiast, love to work on open source platform and technologies.
- Advertisement -

Python is one of the most popular and easy to code programming language nowadays, because of its simplicity and easy to code. It is now very popular among beginners and experienced computer programmers or developers.

It is use to develop any kinds of software/applications using simple and few lines of code for complex machine learning algorithms also.

- Advertisement -

The major release version of Python is 3.8 these days. It has included many features like Positional-only parameters, f-strings support, Parallel filesystem cache and many more.

The Python 3.8 version is not included in default Ubuntu repository. So, In this tutorial, we will show you the different ways to install Python on Ubuntu 20.04 Linux system.

In the first process, we will use the deb package from deadsnakes  PPA, and in the second process, we will install Python using source.

Install Python 3 on Ubuntu 20.04 with the apt package manager

To install Python 3 with apt is very simple, and it will install in very few steps only.

Step 1 – First update the package list on Ubuntu and install prerequisites to install Python on Ubuntu using the following commands:

- Advertisement -
$ sudo apt update
$ sudo apt install software-properties-common

Step 2 – Now, need to add the deadsnakes PPA to the running Ubuntu system by using below command:

$ sudo add-apt-repository ppa:deadsnakes/ppa

Step 3 – When new repository gets enabled, update the package list once again and install Python using the following commands:

$ sudo apt install python3.8
- Advertisement -

Step 4 – After installing the Python, we can verify it by checking the version of installed Python:

$ python3.8 --version
output:

Python 3.8.0

If your screen also showing output like above, means Python 3.8 is installed successfully on your Ubuntu system.

Installing Python 3.8 on Ubuntu 20.04 from source

In this method, we will explain the process to install Python 3.8 on Ubuntu 20.04 Linux using source.

Step 1 – In the first step, update the repository package list and install dependencies to build Python on Ubuntu, using the following command:

$ sudo apt update
$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev

Step 2 – Now download Python 3.8 source code from the Python download page by using wget command, as shown below:

$ wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz

Step 3 – after download source package extracts the gzipped file using the following command:

$ tar -xf Python-3.8.0.tgz

Step 4 – Now enter into the new extracted Python source directory and run the configure script to check the system compatibilities, and dependencies to build Python on your system.

$ cd Python-3.8.0
$ ./configure --enable-optimizations

Using --enable-optimizations option to optimize Python binary by running multiple tests, this process may take a longer time.

Step 5 – Now, we can start Python 3.8 build process using make command as shown below:

$ make -j 8

Step 6 – After completing the build process, you can install Python binaries by using the following command:

$ sudo make altinstall

Step 7 – Now, Python 3.8 is installed in your system; you can verify it by checking the version of Python using the following command:

$ python3.8 --version

The output will show in your screen similar like below:

output:

Python 3.8.0

Conclusion

You have learned to install Python in your Ubuntu 20.04 system using two different methods, one is using deadsnakes repository, and another one is using source. Now, your system is ready to develop various python projects.

If you have any questions or doubt on this article, please comment below.

- Advertisement -
- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

Latest article

How to Setup a Firewall with UFW on Debian 10 Linux

Nowadays, a Firewall is an essential utility and property of any system for security; by default Debian Operating system having a firewall...

How to Install Eclipse IDE on Debian 10 Linux

Eclipse is the most famous and widely used Java integrated development environment (IDE). It supports many plugins to enhance the capabilities to...

How to Install Ruby on Debian 10 Linux

Nowadays, Ruby is the most popular language, especially for SaaS application development. It has a perfect and elegant syntax structure, and it...

How to Install MongoDB on Debian 9 Linux

MongoDB is an open-source and free NoSQL document based database system. Nowadays, it is prevalent as most application developers are using MongoDB,...

How to Install Python 3 on Ubuntu 20.04 Linux

Python is one of the most popular and easy to code programming language nowadays, because of its simplicity and easy to code....