🐍 Python 3.12 Setup Guide

🔹 macOS Installation

  1. Install Homebrew (if not already installed):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Update Homebrew:

brew update
  1. Install Python 3.12:

brew install python@3.12
  1. Link Python 3.12 (Optional if multiple Python versions installed):

brew link python@3.12 --force
  1. Verify Installation:

python3 --version


✅ Method 2: From Official Installer

  1. Download: Visit the official page:

    https://www.python.org/downloads/mac-osx/

  2. Install: Run the .pkg installer and follow instructions.

  3. Verify:

python3.12 --version
  1. (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

  1. Run Installer:

    • Check: ✅ “Add Python 3.12 to PATH”

    • Click “Customize installation” (recommended) or “Install Now”

  2. During install:

    • Optionally enable pip, tcl/tk, IDLE, and Add Python to environment variables

  3. Verify Installation:

    Open Command Prompt (Win + R → cmd) and run:

python --version

✅ Post-Installation (All OS)

  1. Check pip:

pip --version
  1. Upgrade pip (Optional):

python -m pip install --upgrade pip
  1. Set Up Virtual Environment:

python -m venv myenv
source myenv/bin/activate     # macOS/Linux
.\myenv\Scripts\activate      # Windows

Last updated