DevHireLab
Tutorials
BootcampProblemsCode SimulatorAI InterviewSoonContact
DevHireLab
Tutorials
BootcampProblemsCode SimulatorAI InterviewSoonContact
Getting Started
01
What is Python and Why Learn It in 2026
02
Installing Python on Windows, Mac, and Linux
03
Setting up VS Code / PyCharm for Python
04
Understanding the Python Interpreter and REPL
05
Writing and Running Your First Python Program
06
Python Syntax and Indentation Rules
Variables and Data Types
01
Variables and Naming Conventions in Python
02
Numbers in Python (int, float, complex)
03
Strings and String Methods in Python
04
Booleans in Python
05
Type Conversion / Casting in Python
06
Understanding the None Type in Python
Operators
01
Arithmetic Operators in Python
02
Comparison Operators in Python
03
Logical Operators in Python
04
Assignment Operators in Python
05
Bitwise Operators in Python
06
Identity (is) and Membership (in) Operators
07
Walrus Operator (:=) in Python
Input, Output & Strings
01
input() and print() Functions in Python
02
f-strings and String Formatting in Python
03
String Slicing and Indexing in Python
04
Common String Methods (split, join, strip, replace)
05
Escape Characters in Python Strings
Control Flow
01
if, elif, else Statements in Python
02
Nested Conditionals in Python
03
for Loops in Python
04
while Loops in Python
05
break, continue, and pass Statements
06
Loop with else Clause in Python
07
match-case (Structural Pattern Matching)
Data Structures
01
Python Lists: Creation, Indexing, Slicing, Methods
02
Python Tuples and Immutability
03
Python Sets and Set Operations
04
Python Dictionaries: Keys, Values, and Methods
05
List Comprehensions in Python
06
Dictionary & Set Comprehensions in Python
07
Working with Nested Lists and Dictionaries
Functions
01
Defining and Calling Functions in Python
02
Function Arguments: Positional, Keyword, Default
03
*args and **kwargs in Python
04
Return Statements in Python Functions
05
Lambda Functions in Python
06
Recursion in Python
07
Variable Scope: Local, Global, Nonlocal
08
Docstrings and Function Annotations
Functional Programming Basics
01
map(), filter(), and reduce() in Python
02
Closures in Python Explained
03
Python Decorators: Basic to Advanced
04
Generators and yield in Python
Object-Oriented Programming (OOP)
01
Classes and Objects in Python
02
The init Constructor in Python
03
Instance vs Class Variables in Python
04
Inheritance in Python (Single, Multiple, Multilevel)
05
Polymorphism in Python
06
Encapsulation in Python
07
Abstraction in Python with the abc Module
08
Magic/Dunder Methods in Python
09
Static and Class Methods in Python
10
The @property Decorator in Python
11
Python Dataclasses Explained
Error Handling
01
try, except, finally in Python
02
Handling Multiple Exceptions in Python
03
Raising Custom Exceptions in Python
04
Understanding Python's Exception Hierarchy
05
Assertions in Python
File Handling
01
Reading and Writing Text Files in Python
02
Working with the with Statement in Python
03
Working with CSV Files in Python
04
Working with JSON Files in Python
05
Working with Directories (os, pathlib) in Python
Modules and Packages
01
Importing Built-in Modules in Python
02
Creating Your Own Modules in Python
03
Understanding Packages and init.py
04
Python Standard Library Overview
05
Installing Packages with pip
Advanced Core Concepts
01
Iterators and Iterables in Python
02
Context Managers in Python (with, contextlib)
03
Multithreading Basics in Python
04
Multiprocessing Basics in Python
05
Asyncio Basics: async/await in Python
06
Memory Management and Garbage Collection in Python
07
Type Hints in Python (typing module)

Installing Python on Windows, Mac, and Linux

Before you write a single line of code, you need Python actually running on your machine — and running correctly. This guide covers how to install Python on Windows, Mac, and Linux, plus the setup steps that trip up almost every beginner: PATH configuration, version conflicts, and picking the right installer for your operating system.

Introduction: Before You Install

It's tempting to just grab the first installer you find and click through it. Don't. A sloppy Python setup is one of the most common reasons beginners get stuck before they've even written "Hello, World." Two problems show up constantly:

  • Version conflicts — ending up with two or three different Python versions on the same machine, none of which behave the way tutorials expect.

  • PATH issues — installing Python correctly, but your terminal still can't find it because the system doesn't know where to look.

Getting this right the first time saves you hours of confusion later.

Checking if Python is already installed

Many systems — especially Mac and Linux — already have some version of Python sitting on them. Before you install anything, check what's there. Open a terminal and run:

# Try this first
python --version

# If that doesn't work, try this instead
python3 --version

If you get a version number back, Python exists on your system. If you get an error, you're starting from scratch — which is fine.

The current stable release

As of 2026, Python 3.14 is the recommended installation for new setups. It's the current stable branch, actively maintained, and it introduced a new installation system (more on that in the next section) that makes managing versions considerably less painful than it used to be.

With that groundwork out of the way, let's walk through how to install Python on Windows, Mac, and Linux — starting with Windows.

Installing Python on Windows

Windows doesn't ship with Python built in, so you have a few installation routes to choose from.

Option 1: Microsoft Store (Python Install Manager)

This is the recommended install method for Python 3.14 and later. Installing through the Microsoft Store gives you the Python Install Manager, a tool that handles automatic updates and lets you manage multiple Python versions without manually juggling installers.

To install it:

  1. Open the Microsoft Store and search for "Python Install Manager."

  2. Click Get and let it download.

  3. Once installed, open a terminal (PowerShell or Command Prompt) and confirm it worked:

python --version

The Store version installs into your user folder, so you don't need admin rights, and it comes with the py launcher, pip, and IDLE included.

Option 2: Traditional installer from python.org

This is the older, "legacy" method — still fully functional, but being phased out in favor of the Install Manager (it won't be produced at all starting with Python 3.16). If you go this route:

  1. Go to python.org/downloads and grab the Windows installer for the latest 3.14.x release.

  2. Run the .exe file.

Critical step: Add Python to PATH

Whichever installer you use, there's one checkbox that matters more than any other: "Add Python to PATH." If you skip this, Windows won't know where to find the python command, no matter how correctly Python itself installed. Check that box before clicking install.

Fixing "python is not recognized"

If you open a terminal after installing and see:

'python' is not recognized as an internal or external command

it almost always means PATH wasn't set correctly. Two fixes:

  • Reinstall and make sure "Add Python to PATH" is checked this time.

  • Manually add it: search "Environment Variables" in the Start menu, edit the PATH variable under your user account, and add the folder where Python was installed (something like C:\Users\YourName\AppData\Local\Programs\Python\Python314\).

Close and reopen your terminal after making changes — PATH updates don't apply to already-open windows.

Optional: WSL (Windows Subsystem for Linux)

If you'd rather work in a Linux-style environment without leaving Windows, WSL lets you run a real Linux distribution (like Ubuntu) alongside your normal Windows setup. Once WSL is installed, you install Python inside it exactly the way you would on native Linux — see Section 4 below.

Installing Python on macOS

Macs come with Python already on them, but don't be tempted to use it for development.

Why not to use the pre-installed system Python

macOS ships with a python3 command tied to Apple's Command Line Tools. It exists to support internal Apple and third-party tooling — it's often an older version, and modifying or removing it can break parts of the operating system. Treat it as off-limits and install your own separate copy instead.

Official installer from python.org (.pkg file)

The most straightforward approach:

  1. Go to python.org/downloads and download the macOS installer — it'll be a .pkg file.

  2. Double-click it and follow the installation wizard.

  3. Open Terminal and confirm:

python3 --version
Alternative: Homebrew method

If you already use Homebrew (or plan to), it's a clean way to install and later upgrade Python:

# Install Python via Homebrew
brew install python

# Confirm the install
python3 --version

Homebrew keeps its own Python separate from the system version and makes future upgrades a one-line command (brew upgrade python).

Use python3, not python

On macOS, the bare python command may not exist at all, or it may point to something outdated. Get in the habit of typing python3 explicitly — that's the command tutorials and most documentation assume you're using on a Mac.

Installing Python on Linux

Linux is the friendliest of the three when it comes to Python — most distributions ship with some version of Python 3 already installed.

Checking your pre-installed version
python3 --version

If it's recent enough for what you're doing, you may not need to install anything. If you need a newer version, your distro's package manager is the way to go.

Installing or upgrading via package manager

On Ubuntu/Debian, using apt:

# Update your package index first
sudo apt update

# Install Python 3
sudo apt install python3

On Fedora, using dnf:

sudo dnf install python3

Both commands install a stable, distro-supported version of Python 3. If you need a specific newer version not available in your default repositories, you may need to add a PPA (Ubuntu) or a third-party repo (Fedora), or build from source — but for most beginners, the default package is enough to get started.

Installing pip separately

Some minimal Linux installations don't bundle pip (Python's package installer) by default. If pip3 --version returns an error, install it separately:

# Ubuntu/Debian
sudo apt install python3-pip

# Fedora
sudo dnf install python3-pip

Verifying Installation & Setting Up a Virtual Environment

Once Python is installed on your OS of choice, confirm it's working correctly and set up your first virtual environment — a step you shouldn't skip, even as a beginner.

Version check, all three OSes
# Windows
python --version

# macOS
python3 --version

# Linux
python3 --version
Why virtual environments matter

Every Python project tends to need its own set of installed packages, often at different versions than other projects on the same machine. Without isolation, you end up with conflicting dependencies — Project A needs one version of a library, Project B needs another, and installing one breaks the other. A virtual environment gives each project its own self-contained Python setup, so nothing steps on anything else.

Creating and activating a venv

Windows:

# Create the environment
python -m venv myenv

# Activate it
myenv\Scripts\activate

macOS/Linux:

# Create the environment
python3 -m venv myenv

# Activate it
source myenv/bin/activate

Once activated, your terminal prompt will usually show the environment name, confirming you're working inside it. Any packages you install with pip from this point on stay isolated to this project.

What's next

With Python installed and a virtual environment set up, the next logical step is picking an editor. Visual Studio Code, paired with its official Python extension, is a solid free option for beginners — it adds debugging, linting, and autocomplete support without much configuration. From here, you're ready to start writing actual code instead of fighting your setup.

PREVIOUSNEXT LESSON