Python Installation

 



Step-by-Step Guide to Installing Python

Step 1: Download Python

  1. Go to the official Python website: https://www.python.org/downloads/

  2. Click on the "Download Python" button. The website will automatically suggest the latest version for your operating system (Windows, macOS, or Linux).

  3. Save the downloaded file to your computer.

Step 2: Install Python on Windows

  1. Double-click the downloaded .exe file to start the installation.

  2. Important: Check the box "Add Python to PATH" at the bottom before proceeding. This allows you to run Python from the command prompt.

  3. Click "Install Now" to begin the installation.

  4. Wait for the installation to complete, then click "Close" when done.

Step 3: Verify Python Installation on Windows

  1. Open the Command Prompt (cmd) by pressing Win + R, typing cmd, and pressing Enter.

  • Type the following command and press Enter:
    python --version

  1.  If Python is installed correctly, it will display the installed version (e.g., Python 3.11.2).

Step 4: Install Python on macOS

  1. Download the .pkg file from the official Python website.

  2. Open the downloaded file and follow the on-screen instructions to install Python.

  • After installation, open Terminal and type:
    python3 --version

  1.  If installed correctly, you will see the Python version displayed.

Step 5: Install Python on Linux

  • Open Terminal and type:
    sudo apt update

  • sudo apt install python3

  1.  (For Fedora, use dnf install python3, and for Arch, use pacman -S python.)

  • After installation, verify by running:
    python3 --version


Step 6: Install pip (Python Package Manager)

Pip is included with most Python installations. To check if it's installed, run:

  • pip --version


If not installed, install it using:

  • python -m ensurepip --default-pip


Step 7: Running Your First Python Program

  1. Open a text editor (Notepad, VS Code, or PyCharm).

  • Write the following code and save it as hello.py:
    print("Hello, World!")


  • Open a terminal or command prompt and run:
    python hello.py

  •  You should see:
    Hello, World!


✅ Python is now successfully installed! 🎉

Would you like help setting up a development environment (e.g., VS Code, PyCharm)? 😊


Post a Comment

0 Comments