How to install Python on Linux – Step by Step Guide
Python is a general-purpose, widely used high-level programming language. Nowadays, it became very popular for web development, AI, ML, and video game development. In this section, we will discuss how to install python in a Linux system.
Step-by-Step Installation instructions: Python on Linux
Step1: Open the terminal emulator by pressing Ctrl+Alt+T.
Step2: Install the latest version of Python3 by using your Linux distro compatible package manager, also make sure to run the command with the sudo permission.
sudo apt-get install python3
sudo pacman -S python3
sudo dnf install python3
Step3: You would get a message “Do you want to continue?” during the installation process, press ‘y‘ in order to continue the process.
Step4: After the installing process is finished, verify the installation.
Check Python version in Linux
To ensure that the python is successfully installed in our system, let’s test it with a small program.
Python program to print Hello World:
Save the program with filename.py and compile it using python3 in the terminal.
CodeSpeedy@hp-1500:~/Desktop/files$ python3 filename.py
Our python program is compiled and running successfully.
Hope you have enjoyed this and learned how to install python on different Linux systems.
You can also read, How to install C++ on Linux – Step-by-Step Guide