If sudo apt install python3 says Python is already the newest package but you need Python 3.14 (or any release ahead of your Debian default), that is expected. Debian pins python3 so apt, system tools, and many .deb packages keep a stable interpreter. This guide shows how to install the latest Python on Debian next to that default—not on top of it.
You will use one or more of: apt (Debian’s packaged Python), backports on older stable releases, uv (fast upstream installs), pyenv (per-user version switching), or a source altinstall from python.org. Debian documents its Python policy on the Debian Wiki. I ran these steps on Debian 13 and kept real terminal output below.
Tested on: Debian 13 (trixie); kernel 6.12.94+deb13-amd64; amd64; system Python 3.13.5; Python 3.14.6 via
uvandmake altinstall; pyenv 2.7.3.
/usr/bin/python3 or run sudo pip install against the system interpreter. That breaks apt and Debian tooling. Install newer Python side-by-side and use a virtual environment for projects.
Why Debian does not always ship the latest Python
Debian stable chooses one primary python3 per release and updates it on a security and stability schedule. python.org moves faster—Python 3.14.6 is the current stable upstream release at the time of writing—so python3 --version on an LTS-style mindset can lag by several minor versions.
| Debian release | Default python3 (typical) |
Notes |
|---|---|---|
| Debian 13 (trixie) | Python 3.13 | python3.13 package in main |
| Debian 12 (bookworm) | Python 3.11 | Newer lines via backports or uv/pyenv/source |
| Debian 11 (bullseye) | Python 3.9 | Same—use backports or upstream methods for 3.11+ |
There is no Deadsnakes PPA for Debian (that repository is Ubuntu-only). Plan on apt, backports, uv, pyenv, or source.
Check your current Python
Before installing anything, see what Debian already provides:
. /etc/os-release && echo "$PRETTY_NAME"
python3 --version
which python3
apt-cache policy python3On Debian 13:
Debian GNU/Linux 13 (trixie)
Python 3.13.5
/usr/bin/python3
python3:
Installed: 3.13.5-1
Candidate: 3.13.5-1List versioned binaries already on disk:
ls /usr/bin/python3* 2>/dev/null
command -v python3.14 python3.13 2>/dev/nullIf python3.14 is missing, install it with one of the methods below.
Choose an installation method
| Method | Best for | Future-proof? | Jump to |
|---|---|---|---|
apt (python3, python3.X) |
Matching Debian’s supported stack, system packages | Yes within your release | apt install |
| Debian backports | Newer packaged Python on bookworm/bullseye without compiling | Yes while backports is maintained | Backports |
| uv | Fast upstream CPython + modern venv/pip | Yes—tracks python.org builds | uv |
| pyenv | Many versions per user, frequent switching | Yes—builds from upstream tarballs | pyenv |
Source make altinstall |
Exact python.org tarball, system-wide under /usr/local |
Yes—works on any Debian version | Source build |
For most developers on current Debian who need the newest upstream Python, start with uv. Use apt when the Debian default is enough. Use source altinstall when you want /usr/local/bin/python3.14 without extra tools.
Install Python from Debian apt (recommended baseline)
When the Debian version matches your project (for example 3.13 on trixie), install the metapackage and the versioned interpreter together. Package names and versions are listed on packages.debian.org.
sudo apt update
sudo apt install -y python3 python3-venv python3-pipInstall the specific minor series when you need headers and venv support for that line:
sudo apt install -y python3.13 python3.13-venv python3.13-devVerify:
python3.13 --version
python3 --versionPython 3.13.5
Python 3.13.5Create a virtual environment (apt Python)
python3.13 -m venv ~/demo-venv
~/demo-venv/bin/python --version
~/demo-venv/bin/python -m pip --versionPython 3.13.5
pip 25.1.1 from .../demo-venv/lib/python3.13/site-packages/pip (python 3.13)Activate for interactive work:
source ~/demo-venv/bin/activate
python --version
deactivateUse apt for upgrades inside your release:
sudo apt update
sudo apt install --only-upgrade python3.13 python3.13-venvInstall from Debian backports (older stable)
On Debian 12 (bookworm) or 11 (bullseye), a newer packaged Python may appear in backports before the next stable release. Follow Debian Backports instructions and the Debian Wiki — Backports when enabling the suite. Example line for bookworm:
deb http://deb.debian.org/debian bookworm-backports mainThen install from the backports suite (adjust python3.12 to whatever apt-cache search '^python3\.[0-9]+$' shows for backports):
sudo apt update
sudo apt install -t bookworm-backports python3.12 python3.12-venv python3.12-dev
python3.12 --versionBackports availability changes by release—always check apt-cache policy python3.12 before documenting a version for production. If no backports candidate exists, use uv or source instead.
Install latest Python with uv (recommended for upstream)
uv downloads official CPython builds mirrored from python.org. It is the fastest practical path to Python 3.14.x on Debian without compiling. Official project home: github.com/astral-sh/uv.
Step 1: Install uv
curl -fsSL https://astral.sh/uv/install.sh | sh
source "$HOME/.local/bin/env"
uv --versionuv 0.11.25 (x86_64-unknown-linux-gnu)Step 2: Install an upstream Python
uv python list | head -12
uv python install 3.14.6Downloading cpython-3.14.6-linux-x86_64-gnu (download) (34.4MiB)
Installed Python 3.14.6 in 19.75s
+ cpython-3.14.6-linux-x86_64-gnu (python3.14)Confirm:
uv run --python 3.14.6 python --versionPython 3.14.6Step 3: Create a project venv with uv
mkdir -p ~/py-demo && cd ~/py-demo
uv venv .venv --python 3.14.6 --seed
source .venv/bin/activate
python --version
uv pip install requests
python -c "import requests; print(requests.__version__)"Python 3.14.6
2.34.2The --seed flag bundles pip into the venv. Use uv pip for fast installs inside the environment.
To upgrade later:
uv python install 3.14.7 # when published
uv python listuv stores interpreters under ~/.local/share/uv/python/—separate from Debian’s /usr/bin/python3.
Install Python with pyenv
pyenv builds and installs multiple Python versions under ~/.pyenv/versions/. Use it when you regularly switch versions per project. Official repository: github.com/pyenv/pyenv.
Step 1: Install build dependencies and pyenv
sudo apt update
sudo apt install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git
curl -fsSL https://pyenv.run | bashAdd to ~/.bashrc (or ~/.profile):
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"Reload the shell, then:
pyenv --versionpyenv 2.7.3Step 2: Install a Python version
pyenv install -s 3.13.7
pyenv versions* system (set by /root/.pyenv/version)
3.13.7~/.pyenv/versions/3.13.7/bin/python --versionPython 3.13.7Step 3: Select a version per directory
mkdir -p ~/myproject && cd ~/myproject
pyenv local 3.13.7
python --versionpyenv local writes .python-version in the project folder. Use pyenv global 3.13.7 only when you accept that default for your user account—still not for replacing system python3 used by apt.
First compile on a modest VM can take 20–40 minutes; later installs reuse downloaded tarballs.
Install latest Python from source (altinstall)
Use this when you want the exact python.org source tarball installed system-wide under /usr/local, without pyenv or uv. The upstream build guide is in the Python documentation — Building from source.
Install build dependencies once:
sudo apt update
sudo apt install -y build-essential zlib1g-dev libncurses-dev libgdbm-dev \
libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev \
libbz2-dev liblzma-dev curlDownload and build Python 3.14.6 (adjust the patch version when a newer stable release is on python.org):
cd /tmp
curl -fsSLO https://www.python.org/ftp/python/3.14.6/Python-3.14.6.tgz
tar -xf Python-3.14.6.tgz
cd Python-3.14.6
./configure
make -j"$(nproc)"
sudo make altinstallUse make altinstall, not make install. altinstall creates python3.14 and pip3.14 under /usr/local without overwriting Debian’s python3.
Verify:
/usr/local/bin/python3.14 --version
which python3.14
python3 --versionPython 3.14.6
/usr/local/bin/python3.14
Python 3.13.5Create a venv with the new interpreter:
/usr/local/bin/python3.14 -m venv ~/py314-venv
~/py314-venv/bin/python -c "print('altinstall ok')"altinstall okTo upgrade, download a newer tarball, rebuild, and run sudo make altinstall again in the new source tree.
./configure may warn about missing pkg-config or system libmpdec on minimal images. The build still completes; install pkg-config and libmpdec-dev if you want cleaner configure output.
Two Python versions on one system is normal
After following this guide, expect multiple interpreters—that is correct:
| Command | Role |
|---|---|
python3 |
Debian system default—leave for apt and OS tools |
python3.13 |
Versioned Debian package |
python3.14 |
Upstream build (/usr/local or uv/pyenv path) |
.venv/bin/python |
Project-isolated interpreter |
Never point sudo update-alternatives at python3 unless you accept breaking Debian packages.
pip and virtual environments (all methods)
| Task | Command |
|---|---|
| Create venv (Debian apt) | python3.13 -m venv .venv |
| Create venv (altinstall) | python3.14 -m venv .venv |
| Create venv (uv) | uv venv .venv --python 3.14.6 --seed |
| Activate | source .venv/bin/activate |
| Install a package | python -m pip install requests or uv pip install requests |
| Leave venv | deactivate |
If you see pip: command not found before Python is installed, install python3-venv or use uv venv --seed. See the pip user guide for venv best practices.
For installing from GitHub, see install Python package from GitHub.
Uninstall or remove extra Pythons
| Method | Remove |
|---|---|
| apt | sudo apt remove python3.13 python3.13-venv python3.13-dev (only if you added them) |
| uv | rm -rf ~/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu (path from uv python list) |
| pyenv | pyenv uninstall 3.13.7 |
| source altinstall | cd /tmp/Python-3.14.6 && sudo make altinstall uninstall |
Do not remove the default python3 package unless you know exactly what depends on it (apt-cache rdepends python3).
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
python3.14: command not found |
Not installed yet | Use uv, pyenv, or source altinstall; check PATH |
python3 --version unchanged after install |
Expected | Newer Python is side-by-side; use versioned binary or venv |
apt errors after changing /usr/bin/python3 |
Broke system Python | Restore Debian package: sudo apt install --reinstall python3 |
pip install permission errors |
Installing as root on system Python | Use a venv; never sudo pip install on Debian python3 |
| pyenv build fails at ssl/zlib | Missing dev headers | Install libssl-dev, zlib1g-dev, and other build deps listed above |
| uv hardlink warning | Cache on different filesystem | export UV_LINK_MODE=copy or ignore if venv works |
Source configure missing modules |
Optional dev libraries | Install libffi-dev, libsqlite3-dev, libbz2-dev, libreadline-dev |
| venv has no pip (uv) | uv default without seed | uv venv --seed or uv pip install pip |
References
- Python.org — Downloads
- Python.org — Source releases
- Python documentation — Configure/build from source
- Python documentation —
venv - pip — User guide
- Debian Wiki — Python
- Debian Wiki — Backports
- Debian Backports — Instructions
- packages.debian.org — python3
- uv — GitHub repository
- pyenv — GitHub repository
- On-site: install latest Python on Ubuntu (Deadsnakes is Ubuntu-only), apt command, pip command not found
Summary
Install the latest Python on Debian by keeping Debian’s python3 for the OS and adding a newer interpreter beside it. Use apt install python3.13 python3.13-venv when the Debian default is enough; use uv python install 3.14.6 for the fastest upstream path; use pyenv when you switch versions often; use make altinstall from python.org for a /usr/local/bin/python3.14 layout.
Tested on Debian 13: system 3.13.5 unchanged; 3.14.6 via uv and altinstall; 3.13.7 via pyenv; venv + pip workflows verified. Always work inside a virtual environment for project packages—never replace /usr/bin/python3.

