How to Install Python on Ubuntu 18.04

July 9, 2020 Liquid Web

Python is fast becoming one of the most popular programming languages worldwide. Its low entry barrier for new programmers and simple, elegant syntax makes it a fantastic language to start learning. Python is excellent for task automation, and thankfully most Linux distributions come with Python installed right out of the box. This is true of Ubuntu 18.04; however, the Python package distributed with Ubuntu 18.04 is version 3.6.8. This tutorial will cover how to install a newer version of Python, specifically, the latest stable version 3.8.3.

Commands used:
apt update -y
apt install software-properties-common
add-apt-repository ppa:deadsnakes/ppa -y
apt install python3.8 -y
python3.8

apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
< libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev \
< wget libbz2-dev -y
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0b4.tgz

tar -xf Python-3.9.0b4.tgz
cd Python-3.9.0b4
nproc
./configure --enable-optimizations
make -j 4
make altinstall
python3.9

Video by: Justin Palmer

About the Author

Liquid Web

Liquid Web powers online content, commerce, and potential for SMB entrepreneurs and the designers, developers and digital agencies who create for them. Sign up for our <a href="https://www.liquidweb.com/blog">newsletter</a> to stay up to date with our latest content.

More Content by Liquid Web
Previous Video
How to Upgrade PHP on Windows
How to Upgrade PHP on Windows

Keeping your software and applications up-to-date is a crucial part of maintaining security and stability i...

Next Video
How to Install MySQL on Windows
How to Install MySQL on Windows

In this video, we describe how to install MySQL on Windows.

Learn What Qualities to Look for in Your Next Host in Our New Guide!

Download Now