Python 3.9 is the latest major release of Python. It is leveraged with many updates.
Python 3.9 is available from the deadsnakes PPA repository. Moreover, we can also build Python on Linux Mint 20 from the source code.
Installing Python 3.9 on Linux Mint 20 from the PPA repository
Installing Python 3.9 on Linux Mint 20 from the deadsnakes PPA repository is very easy and straightforward.
Perform the below-given steps to install Python 3.9 on Linux Mint 20 from the deadsnakes repository:
Step 1: Update apt cache
Fire up the terminal and update the apt cache with the command:
Step 2: Install the dependencies
Next, type the command to install the required dependencies that are a prerequisite of Python 3.9:
Step 3: Add PPA repository
Next, add the PPA repository:
Step 4: Install Python 3.9
Install Python 3.9 as follows:
Press ‘y’ to continue installing Python 3.9.
Step 5: Verify the Python 3.9 installation
After installing Python 3.9, verify the installation with the command:
Python 3.9 is successfully installed on Linux Mint 20.
Note: In case if you face any dependency issue after installing Python 3.9, then run the below-given command to fix the issue:
Installing Python 3.9 on Linux Mint 20 from the source code
This is another way of installing Python 3.9 Linux Mint 20. It is not recommended to install Python 3.9 from the source code. However, you may need it in various situations.
Perform the below-given steps to install Python 3.9:
Step 1: Install required dependencies for Python 3.9
First, update the apt repository and install dependencies:
Step 2: Get the Python 3.9 source code
Next, get the latest Python 3.9 source code with the wget command:
Step 3: Extract Python 3.9 source code tar file
When the Python 3.9 source code tar file is downloaded, extract the archive with the command:
Step 4: Run configure script
Next, navigate to the Python 3.9.1 directory and run the configure script:
The –enable-optimizations run the various tests and improves the configuration process.
Step 5: Build Python 3.9
Once Python 3.9 is configured, the next step is to build it with the command:
To make the build process faster, you can also specify the number of cores with the –j option as follows:
Step 6: Install Python libraries
Next, install Python 3.9 with the command:
The altinstall will overwrite the existing Python3 binary.
Python 3.9 is installed successfully.
Conclusion
Python 3.9 is the newest release of Python. It is available from the deadsnakes repository and source code. This post explains the Python 3.9 installation on Linux Mint 20.