Python is one of the most important programming languages today. It has become the second most popular language displacing JAVA as per the TIOBE Language Index. Maybe someday, it will overtake C as well.
Learning Python would be a great investment.
In this post, we will share how to install Python in Ubuntu 20.04 and 18.04. Your first step in learning Python.
Briefly, what is Python?
Python is an interpreted, object-oriented, and high-level programming language. It is very popular because it is multi-purpose and multi-paradigm. One of the best and most important features of Python is simple, easy to learn syntax.
This makes it quite flexible and therefore you will find Python in web applications, desktop, system-level, and even in configuration scripts. Support of modules and packages makes it modular and encourages code reuse. That means you write clean and good code.
Below are some of the features,
- Open Source
- Simple and Elegant Syntax
- Automatic Memory Management
- Availability of a large number of modules/libraries for common tasks.
- Runs on Windows, Mac, and Linux
You can visit BeginnersGuide/Overview – Python Wiki for additional details.
Install Python on Ubuntu 20.04
Python is pre-installed in most of the Linux Distributions. Ubuntu 20.04 the latest LTS version has version 3.8.
So go ahead, open a terminal and run the below command to check the python version.
$ python3 --version
The latest Python is available and ready to use.
Python is also available on Ubuntu 18.04, but the version is outdated. Quite obvious as Ubuntu 18.04 was released two years ago.
Either Upgrade Ubuntu to version 20.04 or upgrade Python to the latest version.
1. Open up a terminal, and add the PPA Deadsnakes as shown below.
sudo add-apt-repository ppa:deadsnakes/ppa
2. Then refresh the APT cache.
sudo apt update
3. Run the below command to install the latest Python version 3.8
sudo apt install python3.8
4. Check the version.
$ python3.8 --version
You have successfully installed/upgraded Python to the latest version on Ubuntu 18.04
Ubuntu does come with Python pre-installed, but it may have an older version. You can take advantage of the new features of Python by upgrading it to the latest version.
- Install Pip on Ubuntu – Package Manager for Python
- Install PyCharm – the professional IDE for Python
I hope you found this article helpful. Please share and subscribe.