Sunday, August 24, 2025

🐍Installing Python on Windows, Mac, and Linux

Introduction

Before you start coding, you need to install Python on your system. Fortunately, Python works on Windows, macOS, and Linux. Here’s how you can get it running on your machine.

Installing Python on Windows

  1. Go to the official website: python.org/downloads
  2. Download the latest stable release (look for Python 3.x.x).
  3. Run the installer.
  4. Important: Tick the box Add Python to PATH before clicking Install.
  5. After installation, open Command Prompt and type:
    python --version
    You should see something like:
    Python 3.x.x

Installing Python on macOS

macOS usually comes with Python pre-installed, but it may be outdated.

  1. Download the latest version from python.org.
  2. Run the .pkg installer and follow instructions.
  3. Verify installation by opening Terminal and typing:
    python3 --version

Alternatively, you can install via Homebrew (if you have it):

brew install python

Installing Python on Linux

Most Linux distributions already include Python. To check:

python3 --version

If not installed, use your package manager:

  • Ubuntu/Debian:
    sudo apt update
    sudo apt install python3
  • Fedora:
    sudo dnf install python3
  • Arch:
    sudo pacman -S python

Verifying Your Installation

After installation, run:

python3 --version

If you see a version number (e.g., Python 3.11.5), Python is ready to use!

Mini Exercise (2 minutes)

Open your terminal/command prompt and type:

print("Hello from Python!")

Expected Output

Hello from Python!

What’s Next?

Now that Python is installed, let’s learn how to write your very first program.

➡️ Your First Python Program

⬅️ Back to main Page

No comments:

Post a Comment

🐍What is scikitlearn??