This October 2024, we saw the formal release of Python 3.13 as stable. Although Python 3.12 is currently available and in widespread usage, Python 3.13 seems to have a few more capabilities.
The main highlights include:
- New interactive interpreter based on PyPy
- Experimental JIT compiler for improved performance
- Free-threaded mode to run more processes concurrently by disabling the Global Interpreter Lock
- Incremental (cyclic) garbage collector
- New typing features
- Other notable changes
It is highly recommended that you begin the process of switching to Python 3.13 if you are presently maintaining a Python-related project. Additionally, don’t forget to open new issues on the Python Github page in the event that you discover any problems or difficulties.
Install Python 3.13 on Ubuntu and Other Linux Distributions
There are two methods available for installing Python 3.13 on Ubuntu: using the Ubuntu PPA or manually building and installing from the source code. Although the PPA method is only accessible for Ubuntu users, users of other Linux distributions may want to try the source code method.
Method 1: Use the Ubuntu PPA to install Python 3.13
A person by the name of Deadsnakes manages an Ubuntu PPA to make it simpler for Ubuntu users to install the most recent beta or version of Python. As it’s a one-person project, upgrades may not happen right away, so use it for testing purposes only—don’t use it in production.
Launch your terminal and use these instructions to install Python 3.13:
# Add the Deadsnakes PPA sudo add-apt-repository ppa:deadsnakes/ppa # Update the package database sudo apt update # Install Python 3.13 sudo apt install python3.13
After installation, confirm the Python version:
$ python3.13 --version
Method 2: Use the source code to install Python 3.13
For other Linux distributions, you’ll need to install from source. First, install the necessary dependencies:
# On Ubuntu, Debian, Linux Mint, Kali Linux, Zorin OS, Pop!_OS, etc. sudo apt install pkg-config build-essential # On Fedora, CentOS, Red Hat, AlmaLinux, Rocky Linux, etc. sudo dnf groupinstall "Development Tools" pkgconfig # On Arch Linux, Manjaro, BlackArch, Garuda, etc. sudo pacman -S base-devel pkgconf
Next, download the Python 3.13 source code from the official website. Then, use these commands to build and install:
# Extract the tarball file and enter the extracted directory tar -xf Python-*.tgz && cd Python-*/ # Configure the package with necessary requirements ./configure --enable-optimizations # Build and install Python 3.13 make && sudo make install
Verify the installation:
$ python3.13 --version
Also Read: How To Setup Subdomains & LetsEncrypt On NGINX
Removing Python 3.13 from Linux
To uninstall Python 3.13 installed via the Deadsnakes PPA on Ubuntu:
sudo add-apt-repository --remove ppa:deadsnakes/ppa sudo apt remove python3.13 sudo apt autoremove
To remove Python built from source:
sudo find /usr/local/ -name "*python*3.13*" | sudo xargs -n 1 -tp rm -rf
The above command will ask for confirmation before deleting Python 3.13-related files and folders. Press “y” to confirm.
That’s all. If you encounter any issues during the installation or removal process, especially when using the source code method, feel free to ask for help in the comments section. For more such informative guides, read the VPSwala Blog regularly.