Python Tutoring Online
 Home            

How to Install Python on Windows, Mac and Linux

Before you can start writing Python programs, you need to install the Python programming language on your computer. Python is available for Windows, macOS and Linux, and the installation process is straightforward for beginners.

This guide explains how to install Python step by step on Windows, macOS and Linux. You will also learn how to check whether Python is already installed, verify the installation, run your first Python program and solve common Python installation problems.

Whether you are learning Python for school, university, programming, data science, automation, web development or machine learning, installing Python correctly is the first step.

Where to Download Python

The best place to download Python is the official Python website. The official website provides Python installers and downloads for different operating systems.

Download Python from the official website

Always download Python from the official Python website or another trusted source. Avoid downloading Python installers from unknown third-party websites.

Check If Python Is Already Installed

Before installing Python, you can check whether Python is already installed on your computer.

The command you use depends on your operating system.

Check Python on Windows

Open Command Prompt or PowerShell and enter:

Terminal
python --version

You can also try:

Terminal
py --version

Check Python on macOS

Open the Terminal application and enter:

Terminal
python3 --version

Check Python on Linux

Open a terminal and enter:

Terminal
python3 --version

If a Python version is displayed, Python is already available through that command. If the command is not found, continue with the installation instructions below.

How to Install Python on Windows

Windows users can install Python using the official Python installation tools. The current Python installation process is designed to make it easy for beginners to install Python and start running Python programs.

Step 1: Download Python for Windows

Go to the official Python downloads page and select the Windows download:

Download Python for Windows

Step 2: Install Python

Open the downloaded Python installer and follow the instructions shown on the screen.

Allow the installation process to complete. If Windows asks for administrator permission, approve the installation.

Step 3: Verify Python on Windows

Open Command Prompt or PowerShell and enter:

Windows
python --version

You can also check the Python launcher:

Windows
py --version

If the installation was successful, Windows will display the installed Python version.

Python PATH on Windows

The PATH environment variable allows Windows to find programs when you enter commands in Command Prompt or PowerShell.

If Python is available through your PATH, you can run:

Windows
python

This starts the Python interpreter.

If Windows reports that Python cannot be found, check your Python installation and PATH configuration. After changing environment variables, close and reopen Command Prompt or PowerShell before testing again.

How to Install Python on macOS

Python can be installed on a Mac using the official Python installer. The official macOS installer is provided as a .pkg file.

Step 1: Download Python for macOS

Visit the official Python macOS downloads page:

Download Python for macOS

Step 2: Open the Python Installer

After downloading Python, locate the .pkg installer and double-click it.

The macOS installation wizard will guide you through the installation.

Step 3: Complete the Installation

Follow the instructions displayed by the installer. Click Continue when prompted and allow the installation to finish.

Step 4: Verify Python on macOS

Open Terminal and enter:

Terminal
python3 --version

If Python has been installed correctly, Terminal will display the installed Python 3 version.

How to Install Python on Linux

Many Linux distributions already include Python 3 or provide it through their package manager. The exact installation command depends on the Linux distribution you are using.

Install Python on Ubuntu

Ubuntu uses the apt package manager. First update the package information:

Terminal
sudo apt update

Then install Python 3:

Terminal
sudo apt install python3

After installation, verify Python:

Terminal
python3 --version

Install Python on Debian

Debian also uses the apt package manager.

Terminal
sudo apt update
sudo apt install python3

Check the installation:

Terminal
python3 --version

Install Python on Fedora

Fedora uses the dnf package manager.

Terminal
sudo dnf install python3

Verify the installation:

Terminal
python3 --version

Install Python on Arch Linux

Arch Linux uses the pacman package manager. Python can be installed using:

Terminal
sudo pacman -S python

Verify Python:

Terminal
python --version

How to Verify Your Python Installation

After installing Python, it is important to verify that the Python interpreter is working correctly.

Windows

Windows
python --version

macOS and Linux

Terminal
python3 --version

A successful installation should display a Python 3 version number.

Find the Python Installation Location

You can find the location of the Python executable on your computer. This is particularly useful if you have more than one Python installation.

Windows

Windows
where python

macOS and Linux

Terminal
which python3

Run Python After Installation

Once Python is installed, you can start the Python interpreter directly from the command line.

Windows

Windows
python

macOS and Linux

Terminal
python3

You can then enter Python commands directly into the interpreter. For example:

Python
print("Hello Python")

Run Your First Python Program

After installing Python, create a file named hello.py and add the following code:

Python
print("Hello, World!")

Save the file as hello.py.

Run the Program on Windows

Open Command Prompt, move to the folder containing the file and run:

Windows
python hello.py

Run the Program on macOS or Linux

Terminal
python3 hello.py

Output

Hello, World!

What Is pip in Python?

pip is the package installer commonly used with Python. It allows programmers to install additional Python packages and libraries.

For example, developers use Python packages for data analysis, automation, web development, machine learning and many other applications.

Check pip on Windows

Windows
python -m pip --version

Check pip on macOS and Linux

Terminal
python3 -m pip --version

Install a Python Package with pip

After pip is available, you can install a package using the install command.

Windows

Windows
python -m pip install requests

macOS and Linux

Terminal
python3 -m pip install requests

Python Virtual Environments

When working on Python projects, it is good practice to use a virtual environment. A virtual environment provides an isolated environment for a project and helps prevent conflicts between package versions.

Python includes the built-in venv module for creating virtual environments.

Create a Virtual Environment on Windows

Windows
python -m venv .venv

Create a Virtual Environment on macOS and Linux

Terminal
python3 -m venv .venv

Common Python Installation Problems

Python Is Not Recognized on Windows

If Windows reports that Python cannot be found, first try:

Windows
py --version

If the py command works but python does not, check your Python installation and PATH configuration.

Python3 Is Not Found on macOS or Linux

If the python3 command is not available, Python 3 may not be installed or may not be available through your system PATH.

On Ubuntu or Debian, you can install Python using:

Terminal
sudo apt update
sudo apt install python3

Multiple Python Versions Are Installed

It is possible to have more than one Python version installed on a computer. This can sometimes cause confusion about which Python interpreter is being used.

On Windows, check:

Windows
python --version
where python

On macOS and Linux, check:

Terminal
python3 --version
which python3

Python Installation Checklist

Task What to Do
Download Python Download Python from the official Python website.
Install Python Follow the installation instructions for your operating system.
Verify Python Run the Python version command.
Test Python Run a simple Python program.
Check pip Verify that pip is available.
Learn Python Start with Python syntax, variables, data types and operators.

Frequently Asked Questions About Python Installation

How do I install Python?

Download Python from the official Python website and follow the installation instructions for Windows, macOS or Linux. After installation, verify Python using the appropriate version command.

Where can I download Python?

Python can be downloaded from the official Python website: python.org .

How do I install Python on Windows?

Download the Windows Python installer or installation tool from the official Python website, complete the installation and verify it using python --version or py --version.

How do I install Python on Mac?

Download the official macOS Python installer, open the .pkg file and follow the installation instructions. After installation, use python3 --version in Terminal to verify Python.

How do I install Python on Ubuntu?

Ubuntu users can normally install Python 3 through the apt package manager:

Terminal
sudo apt update
sudo apt install python3

How do I know if Python is installed?

On Windows, use python --version or py --version. On macOS and Linux, use python3 --version.

What should I do after installing Python?

After installing Python, start with the basic Python concepts such as syntax, variables, data types, input and output, operators, comments and indentation. You can then move on to lists, dictionaries, functions and other Python programming topics.

What to Learn After Installing Python

Once Python is installed, continue with the fundamental Python topics in this tutorial:

Summary

Installing Python is the first step toward learning Python programming. Python can be installed on Windows, macOS and Linux using the appropriate installation method for each operating system.

After installation, verify Python by checking its version and run a simple program such as print("Hello, World!"). Once Python is working correctly, you can begin learning Python syntax, variables, data types, operators, functions and other programming fundamentals.

Need Help Installing or Learning Python?

Having difficulty installing Python or getting started with Python programming? An experienced online Python tutor can help you install Python, understand the basics and learn programming step by step.

One-to-one Python tutoring provides practical coding exercises, clear explanations and personalized help with Python fundamentals, assignments, projects and programming problems.

Get Python Tutoring Help




Stuck Learning Python?

Struggling with Python syntax, assignments or debugging errors? Learning alone can be frustrating.

Get 1-on-1 Python tutoring and learn faster with clear explanations, real examples and live help.

    Get Python Tutoring

PythonTutor.net

Home    Tutorial     Online Live Trainings    Contact Us           © 2026 All rights reserved by www.PythonTutor.net