🐍 Python 3.12 Setup Guide
🔹 macOS Installation
✅ Method 1: Using Homebrew (Recommended)
Install Homebrew (if not already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Update Homebrew:
brew update
Install Python 3.12:
brew install python@3.12
Link Python 3.12 (Optional if multiple Python versions installed):
brew link python@3.12 --force
Verify Installation:
python3 --version
✅ Method 2: From Official Installer
Download: Visit the official page:
Install: Run the .pkg installer and follow instructions.
Verify:
python3.12 --version
(Optional) Add to path if python3.12 not recognized:
export PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:$PATH"
🔹 Windows Installation
✅ Using Official Installer
Download:
Run Installer:
Check: ✅ “Add Python 3.12 to PATH”
Click “Customize installation” (recommended) or “Install Now”
During install:
Optionally enable pip, tcl/tk, IDLE, and Add Python to environment variables
Verify Installation:
Open Command Prompt (Win + R → cmd) and run:
python --version
✅ Post-Installation (All OS)
Check pip:
pip --version
Upgrade pip (Optional):
python -m pip install --upgrade pip
Set Up Virtual Environment:
python -m venv myenv
source myenv/bin/activate # macOS/Linux
.\myenv\Scripts\activate # Windows
Last updated