


When you compile Python from the source code, you can install the latest version of the application and customize the build options.įirst, we must install the required build dependencies by installing the following APT packages: $ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev Now we will see how to compile Python from the source code. Install Python 3.9.1 on Ubuntu 20.04 from Source Code The following command can help you identify the install location of Python executable binary: $ which python3.9 We can verify that the operation was successful by running: $ python3.9 -version Once the repository is added, you can install Python 3.9 simply by executing: $ sudo apt install python3.9 You should see the newly added repo deadsnakes in the output at the end: Now press the enter to continue, and add the new repository.

You’ll see the text info about PPA repository and prompt to continue. Now add the repository to the system’s repository list: $ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt install software-properties-common It is a pretty easy and straightforward process to complete.įirst, we will update the system: $ sudo apt update & sudo apt upgradeīefore adding the Python Ubuntu repository, we need to install the software-properties-common package to manage independent software vendor software sources. Now, we will see how to install Python 3.9 from the PPA repository. You can check that out by typing: $ python3 -version Installing Python 3.9 on Ubuntu using APTīy default, Ubuntu 20.04 comes with Python 3.8 installed. The same steps apply for all Ubuntu-based distribution, like Linux Mint and Elementary OS, and also including other Ubuntu flavors like Kubuntu and previous Ubuntu releases. In this article, you will learn how to install Python 3.9 on Ubuntu 20.04 from a PPA repository, compile it from source code and alternatively compile and install it using Linuxbrew tool. It is one of the best and most commonly used languages for machine learning and AI software. Python is a programming language known for its easy syntax. Python is a simple to use, easy learning programming language and ranks as one of the top most popular programming languages. If you’re using Ubuntu Linux, chances are you will be using some if not many, python-based applications.
