Python Installation β Quick-Pick#
Recommended version#
| Version | Status | Notes |
|---|---|---|
| 3.12 | LTS β recommended | Long-term support, stable ecosystem |
| 3.13 | Current | Released Oct 2024; most packages support it |
| 3.11 | Supported | Still widely used; avoid for new projects |
| < 3.10 | End-of-life | Do not use for new work |
Always use a version β₯ 3.12 for new projects unless a dependency forces otherwise.
Quick install by OS#
| OS | Command | Detailed guide |
|---|---|---|
| Windows | winget install Python.Python.3.12 | Installation β Windows |
| WSL / Ubuntu | sudo apt install python3 python3-pip python3-venv | Installation β WSL Ubuntu |
| macOS | brew install python@3.12 | Installation β macOS |
| Linux | sudo apt install python3 python3-pip python3-venv | Installation β Linux |
Verify any installation#
python --version
python3 --version
pip --version
Output:
Python 3.12.3
Python 3.12.3
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
[!NOTE] On Linux and macOS the default command may be
python3, notpython. Always check which one points to your intended version.
After installing#
Set up a virtual environment before installing any packages:
python -m venv .venv
source .venv/bin/activate # Linux / macOS / WSL
.venv\Scripts\activate # Windows PowerShell
See Virtual Environments for full details.