• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Python on Ubuntu 18.04

Written by Admin, Updated On May 21, 2019
python, ubuntu
How to Install Python on Ubuntu 18.04

Python is popular programming language. By default, in Ubuntu 18.04 python 3 comes pre-installed as default interpreter. If the installation is minimal of Ubuntu then it does not come pre-installed so now we are going to install Python on Ubuntu 18.04.

Python is a versatile programming language and you can use it to write small scripts, build games, develop websites, create machine learning algorithms, analyze data and more.

Prerequisites#

Before you start installing Python on Ubuntu 18.04 you must logged in as nonroot user account with sudo privileges.

Install Python 3 on Ubuntu#

At first, update the package manager index by issue below command:

sudo apt update

Now run the below command to install python 3 with minimal installation.

sudo apt install python3-minimal

You can verify the installation by executing below command:

python3 -V

It will show output as below:

Output
Python 3.6.6

Installing Python 3.7 on Ubuntu#

Python 3.7 is the latest release of the Python language. It includes many new features. You can get more details about Python 3.7 from official website.

It is very easy and straightforward process to install Python 3.7 on Ubuntu. Same as above first need to update package manager index and install prerequisites by running below command:

sudo apt update
sudo apt install software-properties-common

Next, you need to add the deadsnakes PPA to your sources list using below command:

sudo add-apt-repository ppa:deadsnakes/ppa

You will be prompted with message so here hit Enter key to continue:

Output
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Now, repository is enabled so issue below command to install python:

sudo apt install python3.7

Now you can check installed version of python by typing:

python3.7 --version

It should show output as below:

Python 3.7.6

Install Python Modules#

By default, Ubuntu repository have many Python modules. You can search specific modules using below command:

sudo apt search MODULE_NAME

Here, you should replace MODULE_NAME with module name which you want to search.

After that, you can install searched module with with following command:

sudo apt install MODULE_NAME

Same as above replace MODULE_NAME with module name.

Install & Manage Python Packages#

PIP is a package management system used for installation and management of software packages in Python. PIP stands for Python Package Index (PyPI). It is very popular for python package management. You can get more details on following link : How to Install Pip on Ubuntu

Conclusion#

You have installed Python 3 and 3.7 on your Ubuntu 18.04 machine and you can start developing your Python 3 project.

If you have any questions or suggestion don’t hesitate to comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to install Java on CentOS 7 System
Next Article   How to Install Pip on Ubuntu 18.04 System

Related Posts

  • How to Install and Use PHP Composer on Ubuntu 22.04

    How to Install Composer on Ubuntu 22.04

    January 31, 2023
  • How to Install Nginx on Ubuntu 22.04

    How to Install Nginx on Ubuntu 22.04

    January 28, 2023
  • How to Install Python 3.11 on Debian 11

    How to Install Python on Debian 11

    January 25, 2023

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install SSH Keys on Ubuntu 22.04
    How to Set up SSH Keys on Ubuntu 22.04 January 7, 2023
  • How to Install Mongodb on Debian 11
    How to Install MongoDB on Debian 11 Linux January 11, 2023
  • How to Install Puppet Agent on Ubuntu 22.04
    How to Install Puppet Agent on Ubuntu 22.04 January 22, 2023
  • How to Install Python 3.11 on Debian 11
    How to Install Python on Debian 11 January 25, 2023
  • How to Change-Hostname Ubuntu 22.04
    How to Change Hostname on Ubuntu 22.04 January 19, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook