§ 00 python/cpython · stable 3.15.2 · main → 3.16.0 alpha 1+dev

CPython – The Core Implementation of Python

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.

  • Latest stable3.15.2
  • LicensePSF License
  • Written inC & Python
python3 — REPL
>>> 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
>>> 
Illustration — simplified output; exact opcodes vary by version.

§ 01 · warm-up

Code Typing Test

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.

snippet.py ↻ new snippet

Loading snippet…

time 30s wpm 0 acc 100% errors 0 ready

§ 02

What makes CPython the standard

These are the capabilities that make CPython the default Python for developers, libraries and operating systems.

  • 01

    Reference interpreter

    CPython defines how Python behaves in practice. Most tutorials, packages and docs assume it, so code written for CPython runs as expected nearly everywhere.

  • 02

    Bytecode compiler + eval loop

    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.

  • 03

    Standard library

    Hundreds of modules ship with it, including json, sqlite3, asyncio, pathlib and unittest, so many tasks need no extra installs.

  • 04

    C API & extensions

    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.

  • 05

    Automatic memory management

    Reference counting frees most objects immediately, and a cyclic garbage collector cleans up reference loops you never have to track.

  • 06

    Free-threaded build option

    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.

  • 07

    Speed work every release

    Specializing bytecode, an experimental JIT and, in 3.15, explicit lazy imports keep making the interpreter faster.

  • 08

    Runs almost anywhere

    Installers for Windows and macOS, packages on every major Linux distro, and builds for ARM, WebAssembly and mobile targets.

§ 03 · download

CPython download: official source code

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)
Package
Source ZIP of the main branch
Version in ZIP
3.16.0 alpha 1+dev (development)
Latest stable
Python 3.15.2 · October 25, 2026
3.15.0 released
October 9, 2026
Developer
Python core developers · Python Software Foundation
License
PSF License (open source, no GPL code)
Language
C and Python
Platforms
Windows, macOS, Linux, BSD + more (build from source)
Architecture
Source — builds for x86-64, ARM64 and others
File size
Shown by your browser (changes with every commit)
Source
github.com/python/cpython
Checked
December 6, 2026

§ 04

How to download CPython

The button downloads a ZIP file directly. It does not open a download page. Five steps take you from click to verified source.

  1. 1

    Check what you need

    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.

  2. 2

    Click the download button

    It links directly to GitHub's archive of the main branch. Your browser saves main.zip without opening a new tab or another site.

  3. 3

    Confirm the source

    The file comes from github.com/python/cpython, served by GitHub's codeload service. No mirrors and no repackaging.

  4. 4

    Save and extract

    Unzip it into a folder without spaces in the path, for example ~/src/cpython-main. The extracted folder is named cpython-main.

  5. 5

    Verify what you got

    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

What the CPython interpreter does

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.

Who uses it

  • Everyday developers: every script, web app or notebook run with the standard python command.
  • Library authors: anyone shipping C extensions or wheels for NumPy-style packages.
  • Learners and contributors: people reading the source to understand interpreters or to fix bugs upstream.

Learn how this independent site researches facts on the About page.

One language, several implementations

  • CPythonC · reference
  • PyPyRPython · JIT
  • MicroPythonC · microcontrollers
  • GraalPyJava/Truffle · JVM

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.

Use case: speeding up a hot path

Move the heavy loop into a C extension or a Cython module through CPython's C API, and keep the rest in plain Python.

Use case: trying the next release early

Build the main branch to test your project against features that land in the next October release.

§ 06

Installation and first use

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.

Linux & BSD

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.

macOS

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.

Windows

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.

Your first run

  1. Start the REPL with ./python (or python.exe). No special permissions are needed for a local build.
  2. Confirm the build: import sys; sys.version.
  3. Create a virtual environment: ./python -m venv .venv, then install packages with pip inside it.
  4. Optional: add --with-pydebug to configure for a debug build with extra checks.

§ 07

Compatibility and system requirements

This table covers the operating systems that can run CPython. It has nothing to do with which web browsers can view this website.

CPython platform compatibility
PlatformHow you get CPythonStatus
Windows 10 / 11 (x64, ARM64)python.org installer or Install Manager · build with Visual StudioSupported
macOS 11 or laterpython.org .pkg installer · build with Xcode CLTSupported
Linux (glibc, x86-64 / ARM64)Distribution packages · build from sourceSupported
FreeBSD and other BSDsPorts/packages · build from sourceCommunity tier
WebAssembly (WASI / Emscripten)Build from source with the Platforms/ toolingLower tier
iOS & AndroidEmbedded builds for apps (not a standalone app)Lower tier
Windows 7 / 8.1Dropped by current releasesUnsupported
32-bit only, very old systemsDepends on platform tier; not guaranteedUnconfirmed
Build needsA C compiler (GCC, Clang or MSVC), make (or Visual Studio on Windows) and Git or an unzip tool
Optional libsOpenSSL, zlib, libffi, SQLite, Tk and others for the matching stdlib modules
RuntimeNo internet needed. Python runs fully offline after installation.

Platform tiers follow PEP 11 and can change between versions. Check the “What's New” page for the version you build.

§ 08

Pros and cons

An honest review of CPython's strengths and limits, laid out like a code review diff.

cpython-review.diff+5 −5
  • +Reference behavior: what CPython does is what Python does
  • +Largest ecosystem, since nearly every package targets it first
  • +Stable, well-documented C API for native extensions
  • +Free and open source under a permissive license
  • +Predictable yearly releases with about five years of support each
  • −Slower than JIT-focused runtimes like PyPy for long-running pure-Python loops
  • −Standard build has a GIL that limits CPU-bound threads
  • −Building from source needs a C toolchain and several libraries
  • −Main-branch source is pre-release and not meant for production
  • −Higher memory per object than lower-level languages

§ 09

CPython vs PyPy vs Cython vs MicroPython

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.

CPython compared with alternatives
CriteriaCPythonPyPyCythonMicroPython
What it isReference Python interpreterAlternative interpreter with a JITCompiler: Python/Cython code → C extensionLean Python for microcontrollers
Written inC (+ Python stdlib)RPythonPython (generates C)C
Newest Python versionAlways the latest (3.15.2)Usually a few versions behindFollows CPythonSubset of Python 3
C extension supportNative (C API)Partial, via compatibility layerProduces C extensionsOwn native module system
Best forEverything by defaultLong-running pure-Python codeSpeeding up hot functionsEmbedded boards
LicensePSF LicenseMITApache 2.0MIT

Performance depends heavily on the workload. Benchmark your own code before switching. More detail: CPython vs Cython and Python vs CPython.

§ 10

Troubleshooting and best practices

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

Editorial perspectives

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

CPython FAQs

Answers about downloads, licensing, platforms and builds. For longer explanations, see the CPython guides.

Q01What does the download button on this site give me?

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.

Q02Is the main branch a stable Python release?

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.

Q03Is CPython free?

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.

Q04What is the difference between CPython and Python?

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.

Q05Do I need to download CPython separately to use Python?

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.

Q06How do I build CPython from the downloaded ZIP?

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.

Q07Which operating systems does CPython support?

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.

Q08What is the difference between CPython and Cython?

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.

Q09Does CPython have a GIL?

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.

Q10How often is CPython updated?

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.

Q11Where can I report a CPython bug?

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.

Get the CPython source, straight from GitHub

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)