Installing Python from Python.org

Step 1: Download Python

  1. Visit the Official Python Website:
  2. Navigate to the Downloads Section:
    • On the homepage, you’ll see a prominent “Downloads” button.
    • The website automatically detects your operating system and suggests the latest stable version of Python (currently Python 3.12.x or newer).
    • Important: Download Python 3.10 or newer for best compatibility with modern libraries and VS Code.
    • Click the “Download Python X.Y.Z” button (where X.Y.Z is the latest version number).
  3. Platform-Specific Download Options:
    • Windows: Download the Windows installer (64-bit recommended for most systems)
    • macOS:
      • For Apple Silicon Macs (M1/M2/M3): Download the “macOS 64-bit universal2 installer”
      • For Intel Macs: Download the “macOS 64-bit Intel-only installer”
    • Linux: Most distributions include Python 3, but you may want to install the latest version

Step 2: Install Python

Windows

  1. Run the Installer:
    • Locate the downloaded .exe file in your Downloads folder and double-click to run it.
    • Important: Right-click and select “Run as administrator” if you encounter permission issues.
  2. Critical Installation Options:
    • MUST CHECK: “Add Python to PATH” - This is essential for VS Code and command line usage
    • MUST CHECK: “Add Python to environment variables”
    • Choose “Install Now” for default installation, or “Customize installation” for advanced options
  3. Recommended Custom Options (if you choose Customize installation):
    • Ensure “pip” is checked (Python package installer)
    • Check “py launcher” for easier Python version management
    • Install location: Use default (C:\Users\[Username]\AppData\Local\Programs\Python\)
  4. Verify Installation:
    • Open Command Prompt (cmd) or PowerShell
    • Test both commands:
      python --version
      py --version
      
    • Both should display the Python version number

macOS

  1. Run the Installer:
    • Open the downloaded .pkg file to start the installation
    • You may need to allow the installer in System Preferences > Security & Privacy if macOS blocks it
  2. Installation Process:
    • Follow the installation wizard with default settings
    • The installer will place Python in /usr/local/bin (Intel) or /opt/homebrew/bin (Apple Silicon)
    • Python applications will be in /Applications/Python X.Y/
  3. Important macOS Notes:
    • macOS comes with an older Python 2.7 - DO NOT use this version
    • Always use python3 command, not just python
    • The new Python will be available as both python3 and python3.x (where x is the minor version)
  4. Verify Installation:
    • Open Terminal (Applications > Utilities > Terminal)
    • Run these commands:

      python3 --version
      python3 -m pip --version
      
    • You should see the Python version and pip version displayed

Linux/Unix

  1. Install via Package Manager:
    • Most Linux distributions include Python by default. However, if you need to install or upgrade Python, use your distribution’s package manager.
    • For example, on Ubuntu:
      sudo apt update
      sudo apt install python3
      
  2. Verify Installation:
    • Open a terminal and run:
      python3 --version
      
    • You should see the installed Python version.

Step 3: Verify Python Installation

  1. Open a Command Line Interface:
    • On Windows, open Command Prompt or PowerShell.
    • On macOS or Linux, open the Terminal.
  2. Check Python Version:
    • Run the following command to verify the installation:
      python --version
      
    • On some systems, you might need to use python3 instead:
      python3 --version
      
    • You should see the Python version number displayed, confirming that Python is installed correctly.

Step 4: Install pip