Back again with another backport of Python for the hardcore core users on Debian! This time it is the Python 3.13 backport for Debian 12 bookworm. Python 3.13 is required for Home Assistant 2025.2 which just dropped an hour ago. If you are not familiar with my backports: this is the fourth one in the series: Python 3.8 for Debian 10, Python 3.10 for Debian 11, Python3.12 for Debian 12 and now also Python 3.13 for Debian 12.
Home Assistant is moving faster though Python versions these days, so Debian 12 was the lucky one to have 2 Python backports already (so far)! However I am still of my beliefs that I prefer the core install without Docker, Supervisor or OS. So we keep going with this project!
There are of course other ways to install Python 3.12 such as pyenv
or compiling from scratch. Packages are much better manageable than compiling the source from scratch. In my opinion it is also more manageable than using pyenv
. By using my packages you will also be sure to get the latest patches (on a best effort basis).
All the info below is a copy-paste of the previous guide, so let me know if there are any errors.
Scope
The scope of this project is limited to backporting just Python 3.13 itself. So no defaults (which provide virtual packages so python3
get’s automatically linked to python3.13
) and no precompiled pip-packages or wheels besides pip itself. Therefore it can coexist with your regular Python (3.11) installation without any interference and still being simple to maintain. It’s main use is for in virtual environments where you can use pip to compile and install any packages you desire. It does provide all the packages and dependencies needed to create a Python 3.13 virtual environment.
So if you want something to use Python 3.13, just execute the command as python3.13
instead of python3
or python
.
Usage for Home Assistant Core
The usage of my packages is tested for people who followed the Install Home Assistant Core advanced guide.
You can follow the steps below to add my repository to your system and then follow that guide while replacing every instance of python3
with python3.13
to get a working virtual environment. There is one major exception:
- There is no
python3.13-pip
package. Pip is included inside the venv-package (in contrary to normally in Debian).
So if you already used that guide before, you only have to install python3.13
, python3.13-dev
and python3.13-venv:
sudo apt install python3.13 python3.13-venv python3.13-dev
Existing users of a Home Assistant virtual environment created with a different Python version must recreate the environment. This can take a very long time, especially if there are no wheels available for your architecture (armhf
is known for this). Upgrading an existing environment is difficult/impossible. It is however possible to create an environment while Home Assistant is running in a different directory, stop Home Assistant and swap them out to minimize downtime.
Repository
NOTE: You should never install keys and add repositories from developers you don’t trust. Decide for yourself if I’m trustworthy and if you have any doubts, check out the source and compile the packages yourself.
Packages can be downloaded from my repository at deb.pascalroeleven.nl
. First you should also add my PGP (which you can get from my website via https) to APT’s sources keyring:
wget -qO- https://pascalroeleven.nl/deb-pascalroeleven.gpg | sudo tee /etc/apt/keyrings/deb-pascalroeleven.gpg
Now you can add my repository by adding a file with my repository to the sources.list.d
directory:
cat <<EOF | sudo tee /etc/apt/sources.list.d/pascalroeleven.sources
Types: deb
URIs: http://deb.pascalroeleven.nl/python3.13
Suites: bookworm-backports
Components: main
Signed-By: /etc/apt/keyrings/deb-pascalroeleven.gpg
EOF
After running apt update
you should now be able to install Python 3.13 related packages.
Chain of trust (sort of)
Packages are built using Github actions along with a file containing the checksums of all packages. Therefore, you can compare the checksums of the packages in the repository with the checksums in Github Actions and trace the entire process (up to 90 days after the build after which the artifacts and logs get removed). This way, if you trust the Github Actions build system, you can be sure that the packages I provide are actually built using the instructions in this repo.
Support
Currently there is support for amd64
, arm64
and armhf
architectures. The amd64
packages are build natively while the arm64
and armhf
packages are crossbuilt. Testing is not possible while crossbuilding, so these packages did not undergo the same amount of testing as usual Debian packages do.
Extra note for people running on armhf
(armv7
)
As there aren’t a lot of pip wheels available for this architecture, it can be a pain to install Home Assistant Core this way. It requires a lot of extra dependencies such as rustc
, ninja-build
, cmake
and libopenblas0
from what I can remember. Also it can therefore take ages to build this. As I will be using this on armv7 myself, I might provide a tutorial on how to install HASS Core on this architecture in the future.
Questions
For more technical details, you can checkout Github
If something is unclear or if you have any problems, please let me know! I consider myself a somewhat advanced system administrator and I might have skipped over some non-trivial steps somehow.