Skip to content

What is a Python Interpreter?

A Python interpreter is the executable program that reads .py files and runs them. When someone says “I have Python 3.12 installed,” they mean a python3.12 binary exists somewhere on their system that can execute Python code. Every Python project needs an interpreter, and most of the complexity in Python tooling comes from managing which interpreter runs where.

Where interpreters come from

Python interpreters arrive on a system through several channels:

  • Operating system packages: macOS ships a system Python at /usr/bin/python3. Most Linux distributions include one too. These are managed by the OS and should generally not be modified directly, which is why PEP 668 exists
  • Official installers: python.org distributes installers for macOS and Windows
  • Package managers: Homebrew (brew install python), apt (sudo apt install python3.12), and similar tools install interpreters alongside other system software
  • Python version managers: Tools like uv and pyenv download and manage multiple interpreter versions. uv stores them in ~/.local/share/uv/python/, pyenv in ~/.pyenv/versions/

Any of these can coexist on the same machine. A developer might have a system Python at 3.10, a Homebrew Python at 3.13, and two uv-managed interpreters at 3.12 and 3.14.

Why multiple interpreters matter

A single machine often has several Python interpreters installed at different versions. This creates two problems that Python tooling exists to solve:

Which interpreter runs when you type python? The answer depends on your PATH, which shell you’re using, and whether a virtual environment is active. This is why python --version can return different results in different terminal windows.

How do you keep project dependencies separate? Packages installed into one interpreter’s site-packages directory are visible to every script that interpreter runs. Virtual environments solve this by creating lightweight copies of an interpreter with their own isolated site-packages.

How tools find interpreters

When a tool like uv needs a Python interpreter, it searches several locations in order:

  1. Managed installations that the tool itself downloaded (e.g., ~/.local/share/uv/python/)
  2. PATH executables like python3, python3.12, or python.exe
  3. Platform-specific locations like the Windows registry

The .python-version file and the requires-python field in pyproject.toml tell tools which version to look for. If the requested version isn’t installed and the tool supports automatic downloads (uv does by default), it downloads one.

This discovery process is why uv run can work on a machine with no Python installed at all: it downloads a managed interpreter, creates a virtual environment from it, and runs your code.

CPython and alternatives

Almost every Python interpreter in use is CPython, the reference implementation written in C. When this handbook says “Python interpreter,” it means CPython unless stated otherwise.

Alternative implementations exist. PyPy uses a JIT compiler for better performance in some workloads. uv can install and manage PyPy interpreters alongside CPython ones.

Learn More

Last updated on

Please submit corrections and feedback...