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 wizard3
Verify Installation
Open Terminal and run:
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:Script Mode
Create a file namedhello.py:
hello.py
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 includespip, the Python package installer:
Troubleshooting
Command Not Found
Ifpython3 or python is not found:
Unix/Linux/macOS
Unix/Linux/macOS
Add Python to your PATH in Then reload:
~/.bashrc or ~/.zshrc:source ~/.bashrcWindows
Windows
The installer should add Python to PATH. If not:
- Search for “Environment Variables” in Windows
- Edit the PATH variable
- Add Python installation directory (e.g.,
C:\Python315)
Permission Denied
On Unix systems, usesudo 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
Quick Reference
Common Python interpreter options:
That’s it! You’re now ready to start developing with CPython. Happy coding!
