Installation
macOS
macOS may come with an older Python. Install the latest:
# Using Homebrew (recommended)
brew install python
# Or download from python.orgDownload link: python.org/downloads — get Python 3.10 or higher.
Windows
- Download the installer from python.org/downloads
- Check “Add python.exe to PATH” during installation
- Click Install Now
Linux
# Debian/Ubuntu
sudo apt update && sudo apt install python3 python3-pip python3-venv
# Fedora
sudo dnf install python3 python3-pipVerify Installation
python3 --version # or just `python --version` on Windows
pip3 --versionVirtual Environment
Always use a virtual environment to keep your project dependencies isolated.
Create
python3 -m venv venvActivate
# macOS/Linux
source venv/bin/activate
# Windows (PowerShell)
.\venv\Scripts\Activate
# Windows (CMD)
venv\Scripts\activate.bat
# Fish shell
source venv/bin/activate.fishDeactivate
deactivateInstall Dependencies
With your virtual environment active:
pip install flask # or whatever your project needs
pip freeze > requirements.txt # save dependenciesTo reinstall later:
pip install -r requirements.txt