Install Python on Windows, macOS and Linux
Step-by-step Python 3 setup for Windows, macOS, and Linux — check your version, add Python to PATH, get pip, and pick an editor.

You don't need a lecture, you need Python running on your machine. So let's get it installed, verified, and ready to write code — Windows, macOS, or Linux, whichever you're on. Skip to your section.
Check if you already have Python
Before you download anything, check whether it's already there. Open a terminal — Command Prompt or PowerShell on Windows, Terminal on macOS or Linux — and run:
python --versionIf you see something like Python 3.12.4, you're done. Any 3.x is fine; this series targets Python 3, and nothing below it matters anymore. Note the number after the first dot — 3.8, 3.11, 3.12 — higher is newer, and anything 3.8+ will follow along here without trouble.
Two things can go wrong. You might get Python 2.7.x, which is dead and gone — ignore it and try the next command. Or you might get an error like command not found. In both cases, try:
python3 --versionOn macOS and Linux, python3 is the command that actually points at Python 3, so that's the one to trust. If python3 --version prints a 3.x number, you already have it and can jump straight to the editor section. If it errors too, install Python using your platform below.
Windows
Windows doesn't ship with Python, so you'll download it. Go to python.org/downloads and grab the latest Python 3 installer for Windows. It's a normal .exe — double-click to run it.
Here's the one step people get wrong. On the very first installer screen, before you click anything else, check the box that says Add python.exe to PATH at the bottom. It's easy to miss and it's the difference between python working everywhere and python working nowhere.
With that box ticked, click Install Now and let it finish. When it's done, open a fresh Command Prompt (a window you opened before installing won't know about the change) and verify:
python --versionA 3.x number means you're set. If you forgot to check the PATH box, the fastest fix is to re-run the installer, choose Modify, and tick it — or uninstall and reinstall with the box checked. Don't fight it by hand.
Quick check
On Windows, why check 'Add Python to PATH' during install?
macOS
macOS comes with an old system Python you should leave alone. The clean way to install a real, up-to-date Python is Homebrew, the package manager most Mac developers use. If you don't have Homebrew yet, the one-line install command is on its homepage; paste it into Terminal and follow the prompts.
Once Homebrew is set up, installing Python is one line:
brew install pythonHomebrew downloads the latest Python 3 and wires up the commands for you. Verify with:
python3 --versionYou should see a 3.x version. On macOS you'll use python3 and pip3 (more on pip in a second), not bare python — the next callout explains why.
Linux (Ubuntu/Debian)
Most Linux distributions already include Python 3, since the system itself uses it. Still, install it explicitly so you also get pip, the package tool, which often isn't there by default. On Ubuntu or Debian:
sudo apt update && sudo apt install python3 python3-pipsudo apt update refreshes the list of available packages first; then the install pulls in python3 and python3-pip together. Verify both:
python3 --version
pip3 --versionOn Linux, the command is python3, not python — bare python is frequently missing entirely, and where it exists it can point at the wrong version. Use python3 to run code and pip3 to install libraries, and you'll never have to guess which one you got.
Warning
On macOS and Linux, the bare python command may be ancient Python 2 or not exist at all. Always use python3 and pip3 on these systems. On Windows the installer sets up python and pip for you, so there it's fine.
pip and an editor
You met pip in the last post — it's Python's package installer, the tool that pulls in ready-made libraries so you don't write everything from scratch. It comes bundled with Python on Windows and macOS, and on Linux you just installed it with python3-pip. One command grabs a library off the internet:
pip install requests(On macOS and Linux, that's pip3 install requests.) Don't worry about what requests does yet — the point is that installing it is this easy, and you'll use this constantly later.
For writing code, you want a real editor, not Notepad. I'd reach for VS Code — it's free, fast, runs on all three platforms, and almost everyone uses it. After installing it, open the Extensions panel (the icon that looks like stacked blocks), search for Python, and install the official Microsoft extension. That gives you autocomplete, error highlighting as you type, and a Run button for your scripts. It turns a plain text editor into something that actually helps you.
No install? Run Python in the browser
Here's the thing — you don't strictly need any of this yet. Every lesson in this series has a runnable editor built into the page, the same one you used in the last post. It runs real Python in your browser with nothing installed:
Hit Run and it executes, whether or not Python is on your machine. So if you're stuck on setup or just want to keep learning right now, ignore the installer and use the editors on the page. Install Python when you're ready to build something that lives outside the browser — a script on your own machine, a project you can share.
Recap and what's next
Check first with python --version or python3 --version. On Windows, download from python.org and tick Add Python to PATH. On macOS, brew install python. On Ubuntu or Debian, sudo apt install python3 python3-pip. Remember that python3 and pip3 are the safe commands on macOS and Linux. Grab VS Code plus the Python extension, and you've got a real setup.
Still fuzzy on why you're doing all this? Revisit why Python is worth learning. Otherwise, let's write something real: write your first real program.

Written by
Rhythm Bhiwani
Engineer and relentless builder, happiest reverse-engineering hard problems until they click.
Enjoyed this?
Tap the heart to leave some love.
Be the first to react
Comments
Join the conversation.
Loading comments…


