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
Fork the repository
Visit github.com/python/cpython and click the “Fork” button to create your own copy of the repository.
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:Troubleshooting
Missing configure script
Missing configure script
If However, this is rarely needed as the configure script is committed to the repository.
./configure doesn’t exist, you may need to generate it:SSL/OpenSSL errors on macOS
SSL/OpenSSL errors on macOS
macOS’s system OpenSSL may be outdated. Install via Homebrew and configure:
Permission denied errors
Permission denied errors
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:- Build CPython from source
- Read the Developer Guide for comprehensive documentation
- Join the discussion at Python Discourse
