Python¶

Introduction¶
Python is an interpreted programming language used for tasks ranging from small scripts to full web applications.
Application location
Python applications belong in your home directory, not in your DocumentRoot.
Versions¶
Standard version¶
The commands python and python3 use Python 3.14:
[isabell@moondust ~]$ python3 --version
Python 3.14.7
We install patch releases regularly. Run this command to check the exact version currently installed on your Asteroid.
Available versions¶
We provide these Python branches:
| Branch | Upstream security support until |
|---|---|
| 3.11 | 2027-10 |
| 3.12 | 2028-10 |
| 3.13 | 2029-10 |
| 3.14 | 2030-10 |
Python releases first receive bug fixes and later security fixes. Check the official Python version status for the current state of each branch.
We update each provided branch regularly. Once upstream security support ends, that branch is no longer supported and will be removed from our servers.
Selecting a version¶
There is no account-wide version switch. Invoke the versioned binary directly, for example:
[isabell@moondust ~]$ python3.12 --version
Python 3.12.13
[isabell@moondust ~]$ python3.12 -m pip --version
pip 25.0.1 from /usr/lib/python3.12/site-packages/pip (python 3.12)
Use the same versioned binary to run a script or create a virtual environment. Calling pip as a module, for example python3.12 -m pip, ensures that packages are installed for the intended Python version.
Project dependencies¶
Virtual environments¶
Use a virtual environment for each project to keep its dependencies separate from the packages we provide:
[isabell@moondust ~]$ mkdir --parents ~/my-project
[isabell@moondust ~]$ python3 -m venv ~/my-project/.venv
[isabell@moondust ~]$ source ~/my-project/.venv/bin/activate
(.venv) [isabell@moondust ~]$ python -m pip install requests
Collecting requests
[...]
Successfully installed certifi-[...] charset_normalizer-[...] idna-[...] requests-[...] urllib3-[...]
While the environment is active, python and python -m pip refer to the copies inside it. Run deactivate to leave it. To use a different Python branch, create the environment with the corresponding binary, for example python3.12 -m venv ~/my-project/.venv.
User-wide packages¶
Outside a virtual environment, you can install a library for your user account with --user:
[isabell@moondust ~]$ python3 -m pip install --user humanize
Collecting humanize
[...]
Successfully installed humanize-[...]
System packages
pip is configured to permit user installations alongside the system packages we provide. You do not need to pass --break-system-packages yourself.
pipx¶
pipx installs Python command line applications in separate environments so that their dependencies do not interfere with each other or with your projects:
[isabell@moondust ~]$ pipx install pre-commit
creating virtual environment...
installing pre-commit...
done! ✨ 🌟 ✨
installed package pre-commit [...], installed using Python 3.14.7
These apps are now available
- pre-commit
The resulting command is installed to ~/.local/bin, which is already on your $PATH. pipx uses the standard Python version by default; pass --python python3.12, for example, to select another provided branch.
uv¶
We also provide uv, which can create projects, manage their virtual environments and install dependencies:
[isabell@moondust ~]$ uv init ~/my-project
Initialized project `my-project` at `/home/isabell/my-project`
[isabell@moondust ~]$ uv add --directory ~/my-project requests
Using CPython 3.14.7 interpreter at: /usr/bin/python3.14
Creating virtual environment at: .venv
Resolved [...] packages
[...]
+ requests==[...]
[isabell@moondust ~]$ uv run --directory ~/my-project python -c 'import requests; print(requests.__version__)'
2.34.2
uv creates and manages the project's .venv automatically. Run uv --version to check the exact installed uv version.
Web applications¶
Keep a Python web application running with a systemd user service, then connect it to the frontend with a web backend.
The application must listen on 0.0.0.0 or :: and use a port between 1024 and 65535. Listening only on 127.0.0.1, localhost or ::1 does not work with Uberspace web backends.
Popular software¶
The Python-tagged guides in the UberLab provide installation instructions for popular Python applications.