Skip to main content
This guide will help you get CPython installed and running in just a few minutes. Whether you prefer downloading pre-built binaries or building from source, we’ll walk you through the fastest path to writing your first Python program.

Choose Your Installation Method

Download Binary

Fastest way to get started. Pre-built installers available for all major platforms.

Build from Source

Full control over features and optimizations. Recommended for development and customization.

Option 1: Install Pre-Built Binary

On Windows

1

Download Python

Visit python.org/downloads and download the latest Windows installer
2

Run Installer

Double-click the installer and check “Add Python to PATH”
3

Verify Installation

Open Command Prompt and run:
You can also install Python from the Microsoft Store for easier updates and management.

On macOS

1

Download Python

Download the macOS installer from python.org/downloads
2

Install Package

Open the downloaded .pkg file and follow the installation wizard
3

Verify Installation

Open Terminal and run:
Alternatively, use Homebrew: brew install python3

On Linux

Most Linux distributions include Python. To install or update:

Option 2: Build from Source

Building from source gives you the latest features and allows custom optimizations.

Quick Build (Unix/Linux/macOS)

1

Download Source

2

Configure

3

Build

4

Test

5

Install

This installs Python as python3. Use make altinstall to avoid overwriting your system Python.

Quick Build (Windows)

1

Install Visual Studio

Install Visual Studio 2017 or later with Python workload
2

Download Source

Clone the repository or download from python.org/downloads/source
3

Build

Open Command Prompt in the PCbuild directory:
4

Test

Your First Python Program

Now that Python is installed, let’s write your first program!

Interactive Mode

Launch the Python interpreter:
You’ll see the Python prompt:
Try some Python code:
Use quit() or exit() to leave the interactive interpreter.

Script Mode

Create a file named hello.py:
hello.py
Run your script:
Output:

Using Modules

Python’s standard library provides powerful modules:
example.py

Essential Commands

Here are the most common Python commands you’ll use:

Virtual Environments

For project isolation, use virtual environments:
1

Create Virtual Environment

2

Activate

3

Install Packages

4

Deactivate

Virtual environments keep your project dependencies isolated and prevent version conflicts.

Package Management with pip

CPython includes pip, the Python package installer:

Troubleshooting

Command Not Found

If python3 or python is not found:
Add Python to your PATH in ~/.bashrc or ~/.zshrc:
Then reload: source ~/.bashrc
The installer should add Python to PATH. If not:
  1. Search for “Environment Variables” in Windows
  2. Edit the PATH variable
  3. Add Python installation directory (e.g., C:\Python315)

Permission Denied

On Unix systems, use sudo make install or install to a user directory:

Import Errors

If modules can’t be imported, check your Python path:

Next Steps

Installation Guide

Detailed installation instructions for all platforms and build options

Python Tutorial

Official Python tutorial covering language features

Standard Library

Explore Python’s comprehensive standard library

Contributing

Learn how to contribute to CPython development
Always use virtual environments for your projects to avoid dependency conflicts!

Quick Reference

Common Python interpreter options: That’s it! You’re now ready to start developing with CPython. Happy coding!