Ubuntu 18.04 comes with python 3 installation out of the box as default interpreter. In the minimal installation of Ubuntu this does not come pre-installed so now we are going to install Python on Ubuntu 18.04.
Before you start installing Python on Ubuntu 18.04. You must have nonroot user account on your server with sudo privileges.
“Before_You_Begin”>Before You Begin
Before we begin please check whether Python is installed or not on your system by typing
If the output shows Python version then you already have Python installed or if it outputs command not found then Python is not installed. However, you can also upgrade or downgrade version of Python.
“Install_Python_3_on_Ubuntu”>Install Python 3 on Ubuntu
Update package manager index by typing following command
sudo apt update
The following command will provide minimal installation of Python. now to install Python 3 enter following command
sudo apt install python3-minimal
Confirm the installation and check the version of Python by entering the following command.
The output should be:
“Install_Python_2_On_Ubuntu”>Install Python 2 On Ubuntu
Before you install Python on ubuntu 18.04, update package manager index by typing following command.
sudo apt update
Following command will provide minimal installation of Python. now to install Python 2 enter following command.
sudo apt install pytho3-minimal
Confirm installation and check version of Python by entering follwing command.
Output should be:
“Install_Python_Modules”>Install Python Modules
Ubutnu repository already have a lot of Python modules. To Search Python modules enter following command
sudo apt search MODULE_NAME
To install searched Python module enter following command
sudo apt install MODULE_NAME
Here we have learnt how to install Python on Ubuntu 18.04. If You have any queries regarding this then please comment below.