Install Python

  • Python can be written and executed in many different development environments, known as IDEs (Integrated Development Environments) and code editors. Each IDE offers unique features such as code suggestions, debugging tools, project management, and extensions that help developers write efficient and error-free Python programs


  • Installing Python on Windows

    Step-by-Step Guide

    1. Visit the Official Python Website

    Open any web browser and go to the official Python download page: https://www.python.org/downloads/

    2.Download the Python Installer

    Click on “Download Python 3.x.x for Windows” to get the latest stable version.

    3.Run the Installer

    Locate the downloaded .exe file and double-click it to start the installation process.

    4.Important Setup Option

    Select “Add Python 3.x to PATH”
    This ensures Python can be accessed directly from the Command Prompt (CMD).

    5.Choose Installation Type

    • Install Now → Best option for beginners

    • Customize Installation → Optional (select pip, documentation, or installation location)

    6. Complete the Installation

    Wait until the installation finishes, then click Close.


Open Command Prompt:

Win + R → cmd → Enter

python --version
Note: If Python is installed correctly, the installed version will be displayed.

🔹 If Multiple Python Versions Exist

py -V
  • Open IDLE / Optional VS Code Setup

    IDLE (Default Python Editor)

    • Open the Start Menu

    • Search for IDLE (Python 3.x)

    • Click to launch the Python editor

    Visual Studio Code (Recommended Editor)

    • Download and install Visual Studio Code from Microsoft

    • Open VS Code

    • Install the Python extension by Microsoft

    • Press Ctrl + Shift + P

    • Select Python: Select Interpreter

    • Choose your installed Python 3.x version

    Installing Python on macOS

    Download Source

    • Visit the official Python website: https://www.python.org

    • Navigate to Downloads → macOS

    • Download the official .pkg installer (CPython build)

    Graphical Installation (Beginner-Friendly)

    • Double-click the downloaded .pkg file to start the installer

    • Follow the on-screen installation instructions

    • After installation, Python is typically located at:
      /usr/local/bin/python3


🔹 Verify Installation (Terminal)

Open Terminal and run:

python3 --version
  • VS Code / IDLE on macOS

    IDLE

    Installed automatically. Open from Finder or run:


idle3
  • VS Code

    Same steps as Windows:

    • Install Python extension

    • Select Python interpreter


  • ⭐ Quick Reference Commands

🔹 Windows

python --version
py -V

🔹 macOS

python3 --version
pip3 --version