Skip to content
absolute_beginner

How to Install Python

You know Python is installed when your computer answers two questions: Can it find the python command? And can that command run code and print output? This…

Published 2026-05-11Updated 2026-07-287 min read
A close-up of a laptop on a table, displaying a book on test-driven software with Python, set in a comfortable environment.
A close-up of a laptop on a table, displaying a book on test-driven software with Python, set in a comfortable environment. Photo by Mikael Monjour on Pexels.

You know Python is installed when your computer answers two questions: Can it find the python command? And can that command run code and print output? This guide shows you how to get there—step by step, on Windows, Mac, or Linux—so you can move from copy-pasting commands to actually building with Python.

What Does Success Look Like?

Before you start, see the finish line: a working Python setup means you can do three things:

  1. Check the version:
    • Run python --version or python3 --version in your terminal or command prompt. You should see something like Python 3.11.5.
  2. Open the Python REPL:
    • Run python (Windows) or python3 (Mac/Linux). You should see the >>> prompt.
  3. Run a test command:
    • At the >>> prompt, type:
      print("Hello, Python!")
      
      You should see:
      Hello, Python!
      

Preview only: This is your finish line. Don't worry if these steps fail right now—by the end of this guide, you'll be able to do all three.

The Three-Part Model: Interpreter, Terminal, and PATH

Installing Python is not just about downloading a file. There are three moving parts:

<!-- worldmonger:diagram:start id="python-installation-three-part-model" --> Concept map showing how the Python interpreter, terminal or command prompt, and PATH variable connect to enable running Python code from the command line.

How the interpreter, terminal, and PATH work together to let you run Python from anywhere on your computer.

<!-- worldmonger:diagram:end id="python-installation-three-part-model" -->
  • The Python interpreter: The program that runs your code.
  • The terminal or command prompt: The place where you tell your computer to run Python. On Windows, it's Command Prompt; on Mac or Linux, it's Terminal.
  • PATH: The system's way of knowing where to find the python command. If PATH is set up wrong, your computer can't find Python, even if it's installed.

Keep this model in mind as you work through the steps. Each part needs to connect for Python to run.

Step 1: Check If Python Is Already Installed

Don't install Python twice. First, see if it's already there.

On Windows:

  1. Open the Start menu, type cmd, and press Enter to launch Command Prompt.
  2. Type:
    python --version
    
    or
    py --version
    
  3. Press Enter. If you see a version number (like Python 3.11.5), Python is installed.

On Mac:

  1. Open Terminal (Applications > Utilities > Terminal).
  2. Type:
    python3 --version
    
  3. Press Enter. If you see a version number, Python 3 is installed.

On Linux:

  1. Open Terminal.
  2. Type:
    python3 --version
    
  3. Press Enter. Most distributions include Python, but the version may vary.

Tip: If you get an error or no version appears, you need to install Python.

Step 2: Download Python Safely

Always download Python from the official source. This avoids malware and ensures you get the latest stable release.

  • Go to python.org/downloads.
  • The site detects your operating system and suggests the right installer.
  • Download the latest version (Python 3.x.x) for your platform.

Warning: Never download Python from random websites or file-sharing services. The official site is the only safe source.

Step 3: Install Python on Your System

Windows Installation

  1. Double-click the downloaded installer (e.g., python-3.x.x.exe).
  2. Important: Check the box labeled Add Python to PATH before clicking "Install Now." This lets you run Python from any command prompt. (PATH is how Windows knows where to find Python when you type python.)
  3. Click Install Now. Wait for the installer to finish.
  4. Click Close when done.

Verify Installation:

Open Command Prompt and type:

python --version

You should see the Python version number. If not, restart your computer and try again.

Common mistake: Forgetting to check "Add Python to PATH" means you'll have trouble running Python from the command line. If this happens, rerun the installer and choose "Modify," then add Python to PATH.

Mac Installation

  1. Open the downloaded .pkg file (e.g., python-3.x.x-macosx.pkg).
  2. Follow the installer prompts.
  3. When finished, close the installer.

Verify Installation:

Open Terminal and type:

python3 --version

You should see a version number.

Note: On Mac (and Linux), use python3 instead of python. This avoids confusion with older Python 2 versions that may still be present.

Linux Installation

Most Linux distributions already include Python. To check:

python3 --version

If you need to install or upgrade Python, use your distribution's package manager:

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

Check again with:

python3 --version

Tip: If you want to install a specific version or need Python for development, consult your distribution's documentation for advanced options.

Step 4: Test Your Python Setup

Now, prove your install works by running the same test from the finish line preview:

1. Open your terminal or command prompt:

  • On Windows: Command Prompt
  • On Mac/Linux: Terminal

2. Start Python:

  • On Windows, type:
    python
    
  • On Mac/Linux, type:
    python3
    

You should see something like:

Python 3.x.x (default, ...)
>>>

The >>> prompt means you're inside the Python REPL (Read-Eval-Print Loop)—an interactive place to run Python code.

3. Type Python code at the >>> prompt:

print("Hello, Python!")

Expected output:

Hello, Python!

Note: Only type the print(...) line after you see the >>> prompt. That's how you know you're inside Python, not just the system shell.

To exit Python, type exit() and press Enter, or close the window.

What If Something Goes Wrong?

  • Command not found: Double-check your spelling. On Windows, try py instead of python. On Mac/Linux, use python3.
  • PATH issues: If Windows says Python isn’t recognized, rerun the installer and make sure "Add Python to PATH" is checked.
  • Shell vs. Python confusion: If you see a prompt like $, %, or C:\>, you're in the system shell—run commands like python --version there. If you see >>>, you're inside Python—run Python code like print("Hello, Python!") there. Mixing them up is a common beginner mistake.
  • Still stuck? Restart your computer. If problems persist, uninstall and reinstall Python from the official site.

For more troubleshooting, see Common Python Errors for Beginners.

What’s Next? Start Writing Code

With Python installed, you’re ready to write your first program. You can use any text editor, but beginner-friendly options are covered in Python IDEs and Editors for Beginners.

When you’re ready to run your code, check out How to Run Python Code: Scripts, Interactive Mode, and More.

Recap: The Builder’s Checklist

  • Check if Python is already installed.
  • Download Python from python.org.
  • Install and add to PATH (Windows).
  • Use your package manager on Linux.
  • Verify with python --version or python3 --version.
  • Run the Python shell and print something.

Installing Python is not ceremony—it’s the first lever you pull as a builder. When you see the >>> prompt and print your first line, you’ve turned your computer into a tool for building, not just browsing.

Your Next Step

Open your editor, write a simple Python script, and run it. The journey from installation to automation starts with one working command.

Practical resource

Want a more structured Python path?

Use the Python Starter Pack to turn scattered tutorials into a focused practice path.

View the bundle
Coming soon

Python Starter Pack

A compact LearnPyFast PDF pack covering what Python is, installation, your first program, running Python code, and Python versions.

$9
PDF BundleTopic PackPythonBeginner
  • 5 curated chapters
  • Enhanced PDF edition with bundle-only learning guidance
  • Offline-friendly format for focused review
  • Source article links for future online updates

Coming soon

Related sites

Continue beyond Python

Explore related Worldmonger sites when you want to move from Python basics into JavaScript or LLM application building.

JavaScript tutorialstutorial

LearnJSFast

Beginner-friendly JavaScript tutorials for practical web development and self-taught developers.

JavaScriptFrontendWeb development
Visit LearnJSFast
LLM tutorialstutorial

LearnLLMFast

Practical LLM tutorials for builders who want to understand prompting, workflows, agents, and AI applications.

LLMAIBuilders
Visit LearnLLMFast

Keep learning

Related tutorials

Continue with nearby Python topics and beginner-friendly explanations.

High-angle view of woman coding on a laptop, with a Python book nearby. Ideal for programming and tech content.
absolute_beginner7 min read

What is Python?

Programming is the art of turning ideas into instructions a computer can follow. Python is the language that makes this loop—idea, instruction, output,…

Read tutorial
absolute_beginner8 min read

Your First Python Program

Welcome to your very first step into the world of programming! If you’re here, you’re ready to learn Python—a language loved by beginners and professionals…

Read tutorial