Skip to main content
Before you can start contributing to CPython, you’ll need to set up your development environment. This guide will walk you through the process step by step.

Prerequisites

Before you begin, make sure you have:
  • A Unix-like operating system (Linux, macOS, BSD, or Cygwin on Windows)
  • Git for version control
  • A C compiler (GCC or Clang)
  • Basic development tools (make, etc.)
For Windows development, see PCbuild/readme.txt for platform-specific instructions.

Getting the Source Code

1

Fork the repository

Visit github.com/python/cpython and click the “Fork” button to create your own copy of the repository.
2

Clone your fork

3

Add upstream remote

Installing Dependencies

CPython requires various third-party libraries depending on your platform and configuration. Not all standard library modules are buildable on all platforms.

Linux (Debian/Ubuntu)

Linux (Fedora/RHEL)

macOS

macOS has additional configure and build options related to framework and universal builds. See Mac/README.rst for details.

Configuring Your Workspace

Editor Setup

CPython follows specific coding standards. Configure your editor to:
  • Use 4 spaces for indentation (not tabs)
  • Trim trailing whitespace
  • Use Unix-style line endings (LF)
  • Follow PEP 7 for C code and PEP 8 for Python code

Git Configuration

Verification

Verify your setup by running a quick configuration test:
This should display available configuration options. If it works, you’re ready to build CPython!

Troubleshooting

If ./configure doesn’t exist, you may need to generate it:
However, this is rarely needed as the configure script is committed to the repository.
macOS’s system OpenSSL may be outdated. Install via Homebrew and configure:
Ensure you have write permissions in the CPython directory. Avoid using sudo for build operations.

Next Steps

Now that your environment is set up, you’re ready to:

Additional Resources