Installation & Running Python in Python
From the Python cheat sheet ยท Setup & Basics ยท verified Jul 2026
Installation & Running Python
Install Python and run scripts from the command line.
bash
# Install (macOS)
brew install python
# Install (Ubuntu/Debian)
sudo apt install python3 python3-pip
# Install (Windows) โ download from https://python.org/downloads
# Check version
python3 --version
# Run a script
python3 app.py
# Interactive REPL
python3๐ก Use python3 explicitly โ "python" may point to Python 2 on some systems
โก The REPL is great for testing snippets โ type exit() or Ctrl+D to quit
๐ On Windows, use "py" instead of "python3" as the launcher
๐ข Use "python3 -m" to run installed modules as scripts (e.g., http.server, venv)
installsetupcli