Python announced the new 3.14 version yesterday! See what’s new and how to install guide for Ubuntu users.
Python 3.14 is the latest stable release of the Python programming language, with 5 years support until 2030.
Since the release, the free-threaded build of Python is officially supported and no longer experimental. It’s so far optional, though will be make default in next phase.
Python 3.14, the latest version of this popular programming language released. Here’s how to install it in all current Ubuntu releases.
Python 3.14 was 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.
Python, the popular free open-source programming language, finally announced 3.13.0 stable this Monday!
Python 3.13 introduced new interactive shell. It’s enabled by default and based on code from the PyPy project.
When you start the new shell in an interactive terminal, it uses colors by default for prompts and tracebacks and supports multi-line editing.
As well, it supports REPL-specific commands such as help, exit, and quit without call them as functions. And, I can finally use clear command in the shell to clear screen.
The new interactive shell also supports interactive help browsing using F1, history browsing using F2, and ‘paste mode’ with F3 for pasting larger blocks of code.
Just in case for those who don’t like the new shell, it can be disabled by setting environment variable. PYTHON_BASIC_REPL=1.
Python 3.13 shell, with colors, multi-line editing, etc support
When using pip command to install a Python package in Ubuntu 24.04 will output “error: externally-managed-environment“. Here are a few workarounds to ‘fix’ the issue.
As the terminal output shows you, it’s the change due to PEP 668. Since Ubuntu 23.04, it recommends Python-specific package management tools (e.g., pip) to install packages using a virtual environment, to avoid conflicts to packages installed by OS package managers. Though, user can still force pip to install into interpreter’s global context just like before.
This simple tutorial shows how to install Python 3.13 in Ubuntu 24.04, Ubuntu 22.04, and/or Ubuntu 20.04 LTS.
Python 3.13.0 was released on Oct 7, 2024 as the new major release that features new interactive interpreter, that supports multi-line editing, REPL-specific commands such as help, exit, clear, and quit, interactive help, history browsing, and ‘paste mode’ for pasting larger blocks of code.
CPython now has experimental support for free-threaded mode for running threads in parallel on available CPU cores, though disabled by default.
Other changes in Python 3.13.0 include:
New interactive interpreter, features multi-line editing and color support, as well as colorized exception tracebacks.
Experimental free-threaded build mode.
A preliminary, experimental JIT.
The (cyclic) garbage collector is now incremental.
Include a modified version of mimalloc, and enabled by default if supported by the platform.
Docstrings now have their leading indentation stripped, reducing memory use and the size of .pyc files.
The dbm module has a new dbm.sqlite3 backend that is used by default when creating new files.
This simple tutorial shows how to fix broken pip installer after installing Python 3.12 from Deadsnakes PPA in Ubuntu 22.04 and Ubuntu 20.04.
Due to removal of long deprecated pkgutil.ImpImporter class, pip command may not work for Python 3.12 in your Linux with old setuptools. It either just does not work or outputs following error, when installing anything via pip install:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
status = run_func(*args)
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 285, in run
session = self.get_default_session(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 75, in get_default_session
self._session = self.enter_context(self._build_session(options))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 89, in _build_session
session = PipSession(
^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/network/session.py", line 282, in __init__
self.headers["User-Agent"] = user_agent()
^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/network/session.py", line 157, in user_agent
setuptools_dist = get_default_environment().get_distribution("setuptools")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/metadata/__init__.py", line 24, in get_default_environment
from .pkg_resources import Environment
File "/usr/lib/python3/dist-packages/pip/_internal/metadata/pkg_resources.py", line 9, in
from pip._vendor import pkg_resources
File "/usr/lib/python3/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2164, in
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
To fix the issue, you just have to manually install pip for Python 3.12. And, here’s how to do the job in 2 ways.
Method 1: Install pip via ensurepip
Python has a built-in module ensurepip, to provide support for bootstrapping the pip installer into an existing Python installation.
First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command:
python3.12 -m ensurepip --upgrade
After that, you should be able to use the pip installer for Python 3.12 by either pip3.12 or python3.12 -m pip command.
Method 2: Install pip via get-pip.py
In case the previous method does not work for you, Pypa.io provides a script that can do the same job.
First, open terminal (Ctrl+Alt+T) and run command to download the script via wget command:
wget https://bootstrap.pypa.io/get-pip.py
Then, just run the script to download & install pip:
python3.12 get-pip.py
After installation, you may run python3.12 -m pip command to use the pip installer. To bind it to pip3.12, just run alias pip3.12="python3.12 -m pip".
New API for monitoring Python programs running on CPython at low cost.
Per-Interpreter Global Interpreter Locks
Support for the Linux perf profiler to report Python function names in traces.
New type annotation syntax for generic classes
New decorator typing.override() in the typing module.
The new Python release also removed a few deprecated modules, including smtpd and distutils. For Ubuntu 22.04, Ubuntu 20.04, it causes a broken pip. As a workaround, you need to manually install pip for Python 3.12.
How to Install Python 3.12.0 in Ubuntu:
For Ubuntu 22.04, Ubuntu 20.04, and their derivatives such as Linux Mint 21, the Deadsnakes PPA has made the packages for all supported CPU architecture types: amd64, arm64/armhf, ppc64el, and s390x.
1. First, press Ctrl+Alt+T on keyboard to open terminal. Then paste the command below and hit run to add PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
Type user password (no asterisk feedback) when it asks and hit Enter to continue.
2. Ubuntu 20.04+ automatically refresh package cache while adding PPA. However, Linux Mint user may need to do this job manually by running command:
sudo apt update
3. Finally, run command to install Python 3.12:
sudo apt install python3.12
For other Ubuntu editions, you may manually compile Python 3.12 from source tarball.
For developers who want to prepare their project for the latest Python releases, here’s how to install Python 3.12 in all current Ubuntu releases.
Python 3.12 finally goes stable. It features more flexible f-string parsing, Per-Interpreter GIL, new type annotation syntax for generic classes, support for the Linux perf profiler, and many performance improvements, but removed the distutils package and wstr from Unicode. See more about Python 3.12.
How to Install Python 3.12
Python is easy to install in Ubuntu by either using the popular Deadsnakes PPA or building from the source. Choose either one that you prefer.
Option 1: Install Python 3.12 from PPA
For Ubuntu 22.04, Ubuntu 20.04, and their derivatives such as Linux Mint 21, the Deadsnakes PPA has made the packages for all supported CPU architecture types: amd64, arm64/armhf, ppc64el, and s390x.
1. First, press Ctrl+Alt+T on keyboard to open terminal. Then paste the command below and hit run to add PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
Type user password (no asterisk feedback) when it asks and hit Enter to continue.
2. Ubuntu 20.04+ automatically refresh package cache while adding PPA. However, Linux Mint user may need to do this job manually by running command:
sudo apt update
3. Finally, run command to install Python 3.12:
sudo apt install python3.12
Option 2: Compile and install Python 3.12 from source
Don’t trust third-party repositories or you’re running Ubuntu 23.04 or Ubuntu 18.04? It’s easy to build Python from the source tarball.
1. First download the source tarball from its ftp download page:
Finally, run command to set default for /usr/bin/python executable if more then one available:
sudo update-alternatives --config python
Use pip installer for Python 3.12
Due to PEP 668, pip install does no longer work like before. The recommended way to use pip is create a virtual environment first, though there are few workarounds.
First run command to install the pyvenv binary:
sudo apt-get install python3.12-venv
Then, create a virtual environment by running command:
python3.12 -m venv ~/.venv/mypythonapp
This command will create a .venv hidden folder in your user home folder then create a virtual environment called mypythonapp (replace the name as you want).
Next, use the source command to get into that virtual environment:
source ~/.venv/mypythonapp/bin/activate
Finally, run pip command to install a python package.
Tips: Without running source command every time, you may optionally add that virtual environment into PATH, so it can be run in anywhere in terminal.
To do so, either run command below, which works for the terminal window only, or paste it into the end of .profile file (press Ctrl+H in user home to view it) and log-out and back in.
export PATH=$HOME/.venv/mypythonapp/bin:$PATH
Uninstall Python 3.12:
If you installed Python 3.12 using the PPA repository, simply open terminal and run command to remove it:
The popular Python programming language released version 3.11 today. Here’s the new features and how to install guide for all current Ubuntu releases.
Python 3.11 claimed to be 10-60% faster than the previous 3.10, and features:
Exception Groups and except* to raise and handle multiple unrelated exceptions simultaneously.
Add add_note() method to BaseException to enrich exceptions.
Add the tomllib module to the standard library for parsing TOML
Point to exact expression that caused error when printing tracebacks.
New -P command line option and PYTHONSAFEPATH environment variable
Add TypeVarTuple, enabling parameterisation with an arbitrary number of types
Required[] and NotRequired[] to mark whether individual TypedDict items must be present.
Add Self to annotate methods that return an instance of their class
LiteralString to accept arbitrary literal string types, such as Literal["foo"] or Literal["bar"].
dataclass_transform to decorate a class, metaclass, or a function that is itself a decorator.
Removed Py_UNICODE encoder APIs
Macros converted to static inline functions
Many legacy standard library modules deprecated and to be removed in Python 3.13
How to Install Python 3.11 in Ubuntu
For Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04, and their derivatives, such as Linux Mint, there’s a popular Deadsnakes PPA maintains the packages for Python 3.11 as well as other Python versions.
NOTE: The PPA does not support Ubuntu 22.10. You may follow the bottom link to build it from source tarball.
1. First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to add the PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
Type user password when it asks (no asterisk feedback) and hit Enter to continue
2. Then refresh package cache via command below, though it’s done automatically in Ubuntu 20.04+:
sudo apt update
3. Finally, install python 3.11 via command:
sudo apt install python3.11
Or replace python3.11 with python3.11-full for IDE, pip package manager, etc.
Verify:
To verify, run python3.11 --version, python3.11 -m pip --version in terminal.
Set Python 3.11 as default
NOTE: change default Python3 in Ubuntu may cause issues for some default apps, such as GNOME Terminal
You may set the new Python package as default by using update-alternatives command line tool.
1. First, run command to create symbolic links for system default python (change python3.10 depends your Ubuntu edition)
JetBrains announced the 2022.1 release of its PyCharm IDE few days ago. Here’s how to install in Ubuntu in different ways.
What’s New in PyCharm 2022.1
This is the first release of the IDE in 2022. Release highlights include (see release note for details):
Basic http authentication support for custom package repositories
Enhanced code completion for TypedDict
Improved TypedDict per-key warnings
Run commands directly from Markdown files
New Copy code snippet for Markdown.
Code cells remain in Edit mode after execution (Pro)
Optimized cell copy-pasting (Pro)
MongoDB: Editing fields in results (Pro)
New Services UI for Docker (Pro)
How to Install PyCharm 2022.1 in Ubuntu Linux
Method 1: Snap package
JetBrains provides official package for Ubuntu users through the Snap which runs in sandbox. Ubuntu user may just search for and install it from Ubuntu Software:
For choice, you may also press Ctrl+Alt+T on keyboard and run commands below to install it:
sudo snap install pycharm-community --classic
And you may replace pycharm-community with pycharm-professional in command for pro edition.
Method 2: Flatpak package
The IDE is also available to install as Flatpak, another universal package runs in sandbox.
1. First press Ctrl+Alt+T on keyboard and run command to install Flatpak daemon:
sudo apt install flatpak
2. Next, install the Python IDE as Flatpak using command: