How to Install Python 3.14 Beta 2 in Ubuntu
Python 3.14, the next major version of the popular programming language, released the second Beta few days ago. Here’s how to install it in all current Ubuntu releases.
Python 3.14 is planned to be released on October 07, 2025, with 5 years of support until 2030. It’s so far in Beta for testing and software developers to prepare their project for new Python version compatibility.
The new Python 3.14 features deferred evaluation of annotations, t-strings, new module compression.zstd, new type of interpreter, syntax highlighting in PyREPL, and various othern new features, See this page for details.
Install Python 3.14 in Ubuntu
For all current Ubuntu releases, including 20.04, 22.04, 24.04, 24.10, 25.04, and their flavors, Python 3.14 is easy to install by either compiling from source or using an Ubuntu PPA.
Option 1: Install Python 3.14 from PPA
The popular Deadsnakes PPA has built the new Beta for Ubuntu 22.04 and Ubuntu 24.04 on all supported CPU platforms (amd64
, arm64
/armhf
, ppc64el
, s390x
).
Simply press Ctrl+Alt+T
on keyboard to open up a terminal window, then you may run the commands below one by one to install the package.
- First, run command to add the PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
Type your password (no asterisk feedback) when it asks and hit Enter to continue.
- Next, run command to install Python 3.14:
sudo apt install python3.14
For choice, replace
python3.14
withpython3.14-full
in command to also install the Tkinter IDE, samples, pyvenv binary, etc.NOTE: Linux Mint users need to run
sudo apt update
after added PPA to manually refresh system package cache.
After installed the package, run python3.14 --version
command to verify the version, and whereis python3.14
to see where it’s installed (usually under /usr/bin
).
Option 2: Compile Python 3.14 from source code
If you’re not Ubuntu 22.04|24.04 user, or you don’t trust third-party package, then you may compile Python 3.14 by yourself. And, I’ve successfully built it in Ubuntu 20.04 and Ubuntu 25.04.
1. First, go to Python website via the link below to download the source tarball:
So far, the latest is “Python-3.14.0b2.tar.xz“.
2. After that, open Downloads folder, and decompress the tarball. Then, right-click on the extracted source folder and select “Open in Terminal” to open the Python 3.14 source folder as working directory in terminal.
3. Finally, run the commands below one by one in that terminal window to build & install it:
- First, run command to install the dependency libraries:
sudo apt install wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
- Next, configure the source by running command:
./configure --enable-optimizations
If the default configure options do not meet your need, run
./configure --help
to list all available options, and replace the last command accordingly. - Then, run command to compile the source:
make -j4
Here
-j4
means start 4 threads in parallel. Depends on how many CPU cores you have, replace number 4 accordingly. - Finally, run the command below to install:
sudo make install
By default, it builds & installs Python into /usr/local
directory. You may run whereis python3.14
to tell.
Set or Unset Python 3.14 as Default
It’s NOT recommended to set non-pre-installed Python as default in Ubuntu, as it may break things!
If you compiled and installed Python 3.14 from the source tarball, then it should be already ‘set’ as default. Because it creates /usr/local/bin/python3
(link to python 3.14) which is prior to the /usr/bin/python3
.
In the case, you may restore the pre-installed Python as default, by simply deleting the /usr/local/bin/python3
file.
sudo rm /usr/local/bin/python3
Similarly, also delete the pip3
, pydoc3
, idle3
, python3-config
, etc links under /usr/local/bin
.
If you installed Python 3.14 from PPA, then run commands below one by one to set it as default:
- First, run command to tell the pre-installed Python version:
ls -al /usr/bin/python3
It’s Python 3.8 for 20.04, Python 3.10 for 22.04, Python 3.12 for 24.04 & 24.10, and Python 3.13 for 25.04.
- Then, run the command below to install python 3.14 as alternative:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.14 10
- Also, install the pre-installed python (replace
python3.12
accordingly) as an alternative:sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 100
- Finally, run the command below at anytime to choose one as default:
sudo update-alternatives --config python3
Optionally, you may run commands above by replace python3
with pip3
to set default pip installer.
Set virtual environment for python 3.14
Due to PEP 668, it’s recommended to set a virtual environment for installing Python modules and packages without messing up the system packages.
First, if you installed Python 3.14 from PPA, then make sure you also have the pyvenv
binary installed:
sudo apt install python3.14-venv
Then, run the command to create a virtual environment:
python3.14 -m venv ~/.venv/python3.14
Here you may replace ~/.venv/python3.14
to whatever folder in your user home. After that, it creates a copy of Python 3.14 into that folder
Next, run command to get into that virtual environment:
source ~/.venv/python3.14/bin/activate
Finally, run pip
command to install any packages or modules, e.g., pip3 install 123. And, set ~/.venv/python3.14/bin/python3
as the path to the executable for your IDE.
Uninstall Python 3.14
For the PPA package, simply open terminal and run command to remove:
sudo apt remove --autoremove python3.14 python3.14-full
For Python 3.14 built from source, just manually delete all the installed files, by running the commands below one by one:
sudo rm -R /usr/local/lib/python3.14/
sudo rm -R /usr/local/include/python3.14
sudo rm /usr/local/lib/libpython3.14.a
sudo rm /var/lib/dpkg/info/*python3.14*
sudo rm /usr/local/bin/python3 /usr/local/bin/python3.14
sudo rm /usr/local/bin/pip3 /usr/local/bin/pip3.14
sudo rm /usr/local/bin/idle3 /usr/local/bin/idle3.14
sudo rm /usr/local/bin/pydoc3 /usr/local/bin/pydoc3.14
sudo rm /usr/local/bin/python3-config /usr/local/bin/python3.14-config
Finally, delete the .venv (hidden by default, press Ctrl+H to view) in your user home folder to remove the virtual environment.
Source: UbuntuHandbook