Master Code
On The Go

Learn. Practice. Build.

How-To Guide

How to Install Python

A step-by-step guide to getting Python running on Windows, Mac, or Linux โ€” including the one checkbox most beginners miss.

๐Ÿ“‹ What You'll Need

โœ… Python is completely free and open source. No signup, no license fee, no trial period.

๐Ÿ Which Version Should You Install?

Always install the latest stable Python 3 release (Python 3.12 or newer as of 2026).

๐Ÿ’ก Why 3.12+? Newer versions have faster performance, better error messages, and the latest standard library features.

1

Download the Installer

Go to the official website:

๐Ÿ‘‰ python.org/downloads

;

The site detects your OS and shows a big yellow Download Python button. Click it.

Direct download links (in case auto-detection fails):

  • Windows: "Windows installer (64-bit)" โ€” the .exe file
  • Mac: "macOS 64-bit universal2 installer" โ€” works on Intel and Apple Silicon
  • Linux: use your package manager (see Step 2 below)
2

Run the Installer

Windows:

  1. Open the downloaded .exe file
  2. Click "Yes" when asked for permission
  3. โš ๏ธ Check "Add python.exe to PATH" at the bottom of the installer window
  4. Click "Install Now"
  5. Wait for the installation to complete
  6. Click "Close"

โš ๏ธ The #1 mistake: Skipping the "Add Python to PATH" checkbox. If you miss it, python won't work from the command line, and you'll need to reinstall or fix it manually.

Mac:

  1. Open the downloaded .pkg file
  2. Click "Continue" through the installer screens
  3. Accept the license
  4. Click "Install"
  5. Enter your Mac password when prompted
  6. The installer automatically sets up the PATH for you

Linux (Ubuntu/Debian):

Python 3 is usually pre-installed. To check, run:

python3 --version

If it's missing, install it with:

sudo apt update
sudo apt install python3 python3-pip

For Fedora/RHEL:

sudo dnf install python3 python3-pip
3

Verify the Installation

Open a fresh terminal window:

  • Windows: press Win + R, type cmd, hit Enter
  • Mac: press Cmd + Space, type "Terminal", hit Enter
  • Linux: press Ctrl + Alt + T

Run this command:

python --version

You should see something like:

Python 3.12.1

On Mac or Linux, you may need to use python3 instead:

python3 --version

๐Ÿ’ก If you see an error like "python is not recognized", jump to the "Common Errors" section below.

4

Check That pip is Working

Pip is Python's package manager โ€” you'll use it to install libraries. Verify it's installed:

pip --version

You should see something like:

pip 24.0 from C:\Python312\Lib\site-packages\pip (python 3.12)

On Mac/Linux, use pip3 if pip doesn't work:

pip3 --version

If pip is missing, install it with:

python -m ensurepip --upgrade
5

Run Your First Python Script

Create a new file called hello.py in any folder.

Open it in a text editor (Notepad, TextEdit, or VS Code) and paste:

print("Hello, World!")

Save the file. Then in your terminal, navigate to the folder where you saved it and run:

python hello.py

You should see:

Hello, World!

๐ŸŽ‰ Python is now installed and working!

๐Ÿงช Recommended: Use a Virtual Environment

A virtual environment keeps your project's packages isolated from your system Python. This is a best practice from the start.

Create a virtual environment inside your project folder:

# Create it
python -m venv venv

# Activate it
# Windows:
venv\Scripts\activate

# Mac/Linux:
source venv/bin/activate

# Install packages into it
pip install requests

# Deactivate when done
deactivate

๐Ÿ’ก Why bother? Without a virtual environment, installing packages globally can break other projects. Every serious Python project uses one.

๐Ÿ’ป Recommended: Install VS Code Next

Python is installed โ€” but writing code in Notepad isn't fun. Visual Studio Code is the most popular free code editor and has excellent Python support.

๐Ÿ“– How to Install VS Code โ†’

๐Ÿ”ง Common Errors (and Fixes)

โŒ 'python' is not recognized as an internal or external command

Python isn't on your system PATH. Fixes:

  1. On Windows: reinstall Python and check "Add Python to PATH"
  2. Or, use python3 instead of python
  3. Or, use the full path to Python (e.g., C:\Python312\python.exe)

โŒ 'pip' is not recognized

Use Python's module invocation instead:

python -m pip install pytube

โŒ Python 2 vs Python 3 confusion (Mac/Linux)

On older systems, python might point to Python 2. Always check:

python --version
python3 --version

Use python3 and pip3 consistently if this happens.

โŒ Permission denied during install (Mac/Linux)

Don't use sudo pip install โ€” it can break system Python. Use:

pip install --user package_name

Or, better, use a virtual environment (see above).

โŒ Multiple Python versions installed

Check which Python you're using:

where python  # Windows
which python  # Mac/Linux

The first line of output is the one that runs when you type python.

๐ŸŽฏ What's Next?

Python is installed. Time to actually learn it.

โ† All How-To Guides