How to Install Python 3.8 on Ubuntu 18.04 Bionic Beaver

Install Python 3.8 on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Python 3.8 on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user. Python 3.8 is not available in Ubuntu’s default repositories. In this tutorial, we’ll cover two different ways to install Python 3.8 on Ubuntu 18.04.

Python is one of the most popular programming languages in the world. With its simple and easy to learn syntax Python is a great choice for beginners and experienced developers. Python is quite a versatile programming language, you can use it to do almost anything you want, write small scripts, build games, develop websites, and many more.

Install Python 3.8 on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade
sudo apt install software-properties-common

Step 2. Install Python 3.8 on Ubuntu.

  • Install Python 3.8 using PPA repository

Add the deadsnakes PPA repository to your system:

sudo add-apt-repository ppa:deadsnakes/ppa

Once the repository is enabled, install Python 3.8 using the following command:

sudo apt install python3.8

Confirm the installation and check the version of Python by entering the following command:

$ python3.8 --version
Python 3.8.0
  • Install Python 3.8 from the source

Update the packages list and install the packages necessary to build Python:

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

Now, download the latest releases source code from the Python download page:

wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -xf Python-3.8.0.tgz
cd Python-3.8.0
./configure --enable-optimizations

Start the Python build process using make:

make -j 8
sudo make altinstall

Python 3.8 has been installed and ready to be used. Verify it by typing:

$ python3.8 --version
Python 3.8.0

That’s all you need to do to install Python on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.