# 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](https://pydevtools.com/handbook/explanation/what-is-pep-668.md) exists
- Official installers: [python.org](https://www.python.org/downloads/) 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](https://pydevtools.com/handbook/reference/uv.md) and [pyenv](https://pydevtools.com/handbook/reference/pyenv.md) 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](https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment.md) 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](https://pydevtools.com/handbook/explanation/what-is-a-python-version-file.md) and the `requires-python` field in [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md) 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](https://pydevtools.com/handbook/explanation/what-is-python.md), the reference implementation written in C. When this handbook says "Python interpreter," it means CPython unless stated otherwise.

CPython itself includes an experimental [JIT compiler](https://pydevtools.com/handbook/explanation/what-is-cpythons-jit-compiler.md) starting in Python 3.13 that translates hot bytecode into machine code at runtime. It is off by default and does not yet ship in pre-built installers.

Alternative implementations exist. [PyPy](https://pypy.org/) uses a JIT compiler for better performance in some workloads. uv can install and manage PyPy interpreters alongside CPython ones.

## Learn More

- [What is Python?](https://pydevtools.com/handbook/explanation/what-is-python.md) covers the language, CPython, and the broader ecosystem
- [What is a virtual environment?](https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment.md) explains how interpreters and isolated environments relate
- [What is a .python-version file?](https://pydevtools.com/handbook/explanation/what-is-a-python-version-file.md) covers version pinning for development
- [Python version management (uv documentation)](https://docs.astral.sh/uv/concepts/python-versions/) details uv's interpreter discovery and download system
