Use case: debugging a slow loop
Run dis.dis() on the function to see the bytecode, then profile it. Understanding what CPython does often explains the slowdown.
§ 00 python/cpython · stable 3.15.2 · main → 3.16.0 alpha 1+dev
CPython is the original, reference implementation of the Python programming language. It is written mainly in C and maintained by Python's core developers. Whenever you run python from python.org, a Linux distro or Homebrew, CPython reads your code, compiles it to bytecode and executes it. It also provides the standard library, the C API used by thousands of packages, and the interactive REPL. This page lets you download the latest source straight from the official GitHub repository and explains how to build, use and compare it.
>>> import sys
>>> sys.implementation.name
'cpython'
>>> import dis
>>> dis.dis("total = a + b")
LOAD_NAME a
LOAD_NAME b
BINARY_OP 0 (+)
STORE_NAME total
>>>
§ 01 · warm-up
Type a real Python snippet exactly as shown, brackets and quotes included. The timer starts with your first key, and the status bar tracks your speed and accuracy.
Loading snippet…
§ 02
These are the capabilities that make CPython the default Python for developers, libraries and operating systems.
CPython defines how Python behaves in practice. Most tutorials, packages and docs assume it, so code written for CPython runs as expected nearly everywhere.
Your .py file is tokenized, parsed into an AST, compiled to bytecode and run by the evaluation loop. The dis module lets you see every step.
Hundreds of modules ship with it, including json, sqlite3, asyncio, pathlib and unittest, so many tasks need no extra installs.
Write fast modules in C, or use tools like Cython and pybind11 that build on the C API. NumPy and many other key libraries depend on it.
Reference counting frees most objects immediately, and a cyclic garbage collector cleans up reference loops you never have to track.
Besides the standard GIL build, CPython offers a free-threaded build so CPU-bound threads can run in parallel. It is opt-in, so existing code keeps working on the default build.
Specializing bytecode, an experimental JIT and, in 3.15, explicit lazy imports keep making the interpreter faster.
Installers for Windows and macOS, packages on every major Linux distro, and builds for ARM, WebAssembly and mobile targets.
§ 03 · download
Get the complete CPython source tree, including the interpreter, standard library, tests and build files, as one ZIP from the official python/cpython GitHub repository. The download starts in this tab, so you never leave the page.
Download CPython (main.zip)main branch§ 04
The button downloads a ZIP file directly. It does not open a download page. Five steps take you from click to verified source.
If you only want to run Python, the python.org installer is easier. Download this ZIP if you want the source to study, build or contribute.
It links directly to GitHub's archive of the main branch. Your browser saves main.zip without opening a new tab or another site.
The file comes from github.com/python/cpython, served by GitHub's codeload service. No mirrors and no repackaging.
Unzip it into a folder without spaces in the path, for example ~/src/cpython-main. The extracted folder is named cpython-main.
Open README.rst at the top. Its first line states the exact version. For signed release tarballs, use python.org, which publishes signatures.
Never disable antivirus or OS security features to build or run Python.
§ 05
Python is a language specification: rules for syntax and behavior. Something has to actually run the code, and for most people that something is CPython. Guido van Rossum's original Python interpreter grew into it, and the core team still maintains it as the reference: when the language changes, it changes in CPython first.
Its job has three parts. It compiles your source into bytecode. It executes that bytecode in a C evaluation loop while managing memory. And it exposes a C API so native extensions can plug in. The standard library ships alongside it.
python command.Learn how this independent site researches facts on the About page.
Run dis.dis() on the function to see the bytecode, then profile it. Understanding what CPython does often explains the slowdown.
Move the heavy loop into a C extension or a Cython module through CPython's C API, and keep the rest in plain Python.
Build the main branch to test your project against features that land in the next October release.
§ 06
The downloaded ZIP is source code, so “installing” means building it. Pick your OS. Each column shows the official steps from the CPython README and Developer's Guide.
Install a C compiler and the build dependencies your distribution's packages need, such as zlib, OpenSSL and libffi headers.
cd cpython-main
./configure
make -j"$(nproc)"
make test
sudo make altinstall
altinstall installs as python3.16 and leaves your system python3 alone.
Install the Xcode Command Line Tools with xcode-select --install, plus OpenSSL from Homebrew or MacPorts if you need ssl.
cd cpython-main
./configure
make -j8
./python.exe -V
On case-insensitive filesystems (the macOS default) the built binary is called python.exe.
Install Visual Studio 2017 or later with the Python development workload and the optional Python native development tools.
cd cpython-main
PCbuild\build.bat
PCbuild\build.bat -c Debug
PCbuild\amd64\python.exe -V
The default build is Release x64. Use -p to change the platform.
./python (or python.exe). No special permissions are needed for a local build.import sys; sys.version../python -m venv .venv, then install packages with pip inside it.--with-pydebug to configure for a debug build with extra checks.§ 07
This table covers the operating systems that can run CPython. It has nothing to do with which web browsers can view this website.
| Platform | How you get CPython | Status |
|---|---|---|
| Windows 10 / 11 (x64, ARM64) | python.org installer or Install Manager · build with Visual Studio | Supported |
| macOS 11 or later | python.org .pkg installer · build with Xcode CLT | Supported |
| Linux (glibc, x86-64 / ARM64) | Distribution packages · build from source | Supported |
| FreeBSD and other BSDs | Ports/packages · build from source | Community tier |
| WebAssembly (WASI / Emscripten) | Build from source with the Platforms/ tooling | Lower tier |
| iOS & Android | Embedded builds for apps (not a standalone app) | Lower tier |
| Windows 7 / 8.1 | Dropped by current releases | Unsupported |
| 32-bit only, very old systems | Depends on platform tier; not guaranteed | Unconfirmed |
Platform tiers follow PEP 11 and can change between versions. Check the “What's New” page for the version you build.
§ 08
An honest review of CPython's strengths and limits, laid out like a code review diff.
§ 09
These tools are often mentioned together but solve different problems. They are compared here on the same criteria. Cython is a compiler that works with CPython, not a replacement.
| Criteria | CPython | PyPy | Cython | MicroPython |
|---|---|---|---|---|
| What it is | Reference Python interpreter | Alternative interpreter with a JIT | Compiler: Python/Cython code → C extension | Lean Python for microcontrollers |
| Written in | C (+ Python stdlib) | RPython | Python (generates C) | C |
| Newest Python version | Always the latest (3.15.2) | Usually a few versions behind | Follows CPython | Subset of Python 3 |
| C extension support | Native (C API) | Partial, via compatibility layer | Produces C extensions | Own native module system |
| Best for | Everything by default | Long-running pure-Python code | Speeding up hot functions | Embedded boards |
| License | PSF License | MIT | Apache 2.0 | MIT |
Performance depends heavily on the workload. Benchmark your own code before switching. More detail: CPython vs Cython and Python vs CPython.
§ 10
The errors people hit most when building CPython, with practical fixes. For what changed between versions, read the official What's New pages rather than unofficial changelogs.
Traceback ModuleNotFoundError: No module named '_ssl'
fix → OpenSSL headers were missing when you ran configure. Install the dev package (for example libssl-dev), then rerun ./configure and make.
Traceback configure: error: no acceptable C compiler found
fix → Install a toolchain: build-essential on Debian/Ubuntu, Xcode CLT on macOS, or Visual Studio on Windows.
Traceback 'python' is not recognized as an internal or external command
fix → The built binary isn't on your PATH. Run it with its full path, such as PCbuild\amd64\python.exe, or use a python.org installer that adds PATH entries.
Traceback My system tools broke after make install
fix → make install may have replaced the system python3. Use make altinstall or a custom --prefix so your OS keeps its own Python.
Traceback Tests fail on a fresh main-branch build
fix → Main is development code and some tests can be flaky. Pull the latest changes, rebuild, and check the GitHub issue tracker before reporting.
Traceback Download didn't start
fix → Check your browser's downloads panel for a permission prompt, or allow downloads for this site and click the button again.
Best practice: keep one virtual environment per project, pin dependencies, and upgrade to new feature versions only after your test suite passes on them.
§ 11
These are our editors' notes for different kinds of users. They are not user reviews, star ratings or testimonials.
#e1a7c03 perspective(learners)
Reading CPython's source is one of the best ways to understand how interpreters work. Start with Python/ceval.c and the dis module, not the whole repo.
— CPython.net editorial perspective
#4b9d2f1 perspective(teams)
For production, stick to a stable release and plan yearly upgrades. Free-threading and the JIT are worth testing in CI before you rely on them.
— CPython.net editorial perspective
#c0ffee5 perspective(library-authors)
Build and test against the main branch a few months before each October release. Catching breaking C API changes early saves your users a painful upgrade.
— CPython.net editorial perspective
§ 12
Answers about downloads, licensing, platforms and builds. For longer explanations, see the CPython guides.
It downloads main.zip, a ZIP of the current main branch of the official python/cpython repository on GitHub. The file saves in the same tab, so you stay on cpython.net. It is source code (currently 3.16.0 alpha 1+dev), not a ready-to-run installer.
No. The main branch is where Python 3.16 is being developed. For everyday work, use the latest stable release, Python 3.15.2, from python.org. Use the main-branch source to learn the internals, test upcoming features or contribute.
Yes. CPython is open source under the Python Software Foundation License. The repository's README notes that the distribution contains no GPL code, so it can also be used in proprietary projects.
Python is the language: its syntax and rules. CPython is the reference implementation of that language, a program written mainly in C that reads and runs Python code. When you install Python from python.org, you are installing CPython.
No. If you already have Python from python.org, the Microsoft Store, Homebrew or a Linux package manager, you almost certainly already have CPython. Check by running python -c "import sys; print(sys.implementation.name)". It prints cpython.
Extract the ZIP. On Linux or macOS, run ./configure and then make. On Windows, install Visual Studio 2017 or later with the Python development workload and run PCbuild\build.bat. The full steps are in the installation section above.
Official python.org installers cover Windows and macOS (the current macOS package targets macOS 11 or later). Linux and the BSDs build from source or use distribution packages. CPython also builds for other platforms at different support tiers, such as WebAssembly, iOS and Android.
CPython is the Python interpreter. Cython is a separate compiler that turns Python-like code with optional C types into C extension modules, which CPython then imports. You use Cython together with CPython, not instead of it.
The standard build uses a Global Interpreter Lock, so only one thread runs Python bytecode at a time. CPython also offers an optional free-threaded build without the GIL. It started as experimental in 3.13 and became an officially supported option in later releases.
A new feature version ships every October. Python 3.15.0 was released on October 9, 2026. Bugfix releases follow roughly every two months, and each version gets about five years of support in total.
Bugs are reported on the GitHub issue tracker at github.com/python/cpython/issues. The Python Developer's Guide explains how to file a good report and how to contribute fixes.
Free and open source under the PSF License. Builds on Windows, macOS and Linux. The button downloads the official main-branch ZIP from github.com/python/cpython, and you stay on this page while it saves.
Download CPython (main.zip)