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
Download Python
Visit python.org/downloads and download the latest Windows installer
You can also install Python from the Microsoft Store for easier updates and management.
On macOS
Download Python
Download the macOS installer from python.org/downloads
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)
This installs Python as
python3. Use make altinstall to avoid overwriting your system Python.Quick Build (Windows)
Download Source
Clone the repository or download from python.org/downloads/source
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: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:| Option | Description |
|---|---|
-c cmd | Execute Python command |
-m mod | Run library module as script |
-i | Enter interactive mode after running script |
-v | Verbose output (trace imports) |
-O | Optimize bytecode |
-B | Don’t write .pyc files |
-u | Unbuffered output |
