Before you can write a single line of Python, you need Python actually installed on your computer. This step-by-step guide covers Windows, macOS, and Linux, so you can get set up no matter what machine you’re using.
If you’ve read our introduction to what Python is, you already know why it’s worth learning. This guide picks up right where that one left off: getting Python actually running on your machine, so you can move from reading about the language to writing it yourself.
The good news is that installing Python is usually quick and doesn’t require any special technical knowledge — just a bit of patience with a few extra steps depending on your operating system. This guide walks through Windows, macOS, and Linux separately, since each platform handles Python slightly differently.
By the end, you’ll have Python installed, know how to confirm it’s working correctly, and be ready to write and run your very first program.
Installing Python on Windows
Unlike macOS and Linux, Windows doesn’t come with Python pre-installed. According to the official Python documentation for Windows, Python can be obtained from a number of distributors, including directly from the CPython team through the official installer available at python.org.
- Go to python.org/downloads in your browser.
- Click the download button for the latest version of Python for Windows.
- Run the downloaded installer file.
- Important: On the very first installer screen, check the box that says “Add Python to PATH” before clicking install. Skipping this step is the single most common reason Python doesn’t work correctly afterward.
- Click “Install Now” and wait for the installation to finish.
Once it’s done, open Command Prompt (search for “cmd” in the Start menu) and type python --version. If you see a version number like “Python 3.13.1,” the installation worked.
Installing Python on macOS
According to Python’s official macOS documentation, recent versions of macOS include an older, incomplete version of Python used internally by Apple’s own development tools — this isn’t the version you want to use for learning, so you’ll need to install a proper version from python.org instead.
- Go to python.org/downloads/macos in your browser.
- Download the latest macOS installer package.
- Double-click the downloaded file to open the installer.
- Click “Continue” through the introduction and license screens, then click “Agree” to accept the license terms.
- Click “Install” and enter your Mac’s administrator password when prompted.
Once installed, open the Terminal app (found in Applications → Utilities) and type python3 --version. If a version number appears, Python is ready to use. Note the “3” in that command — on macOS, the plain python command can sometimes point to an outdated system version, so it’s safest to get in the habit of typing python3.
Installing Python on Linux
Most Linux distributions include Python already, since many system tools rely on it internally. However, the version pre-installed isn’t always the most current one, so it’s worth checking and updating if needed.
As freeCodeCamp’s beginner guide to Python explains, you can check whether Python 3 is already available by typing python3 --version in your terminal. If it’s missing or outdated, most distributions let you install it directly through the system’s package manager — for example, using apt on Ubuntu and Debian-based systems, or Homebrew if you have it set up on Linux.
For Ubuntu or Debian-based systems, running the following two commands in your terminal will install Python 3:
sudo apt update
sudo apt install python3Once that finishes, confirm the installation the same way as the other platforms: type python3 --version and look for a version number in the response.
How to Confirm Python Is Working Correctly
Regardless of your operating system, the same basic check applies: open your terminal (Command Prompt on Windows, Terminal on macOS and Linux) and run the version command for your platform. If a version number appears, you’re ready to write your first program. If you instead see an error like “command not found” or “not recognized,” it usually means either the installation didn’t complete properly, or the “Add to PATH” step was missed on Windows — reinstalling and paying close attention to that checkbox usually resolves it.
As a genuinely simple first test, try running Python interactively. Type just python3 (or python on Windows) and press Enter — this opens Python’s interactive shell, where you can type print("Hello, world!") and press Enter to see it print immediately. Type exit() to leave the shell when you’re done.
What Gets Installed Alongside Python
When you install Python, you’re not just getting the core language — you’re also getting a few essential companion tools that make the whole experience work. The most important of these is pip, Python’s package manager, which lets you install additional libraries and tools that aren’t part of Python’s standard library. You won’t need pip on day one, but you’ll use it constantly once you start building slightly more advanced projects that rely on external packages.
On Windows and macOS, the official installer also sets up IDLE, a simple built-in development environment that comes bundled with Python. It’s not fancy, but it’s genuinely useful for quick experiments before you’ve settled on a full code editor like the ones covered in our code editors guide. Opening IDLE and typing a few lines of code is a perfectly reasonable way to confirm your installation works, even before you install anything else.
Troubleshooting Common Installation Problems
A handful of issues account for almost every installation problem beginners run into, and knowing them in advance can save a lot of frustration.
“python is not recognized” (Windows): This almost always means the “Add Python to PATH” checkbox was missed during installation. The fix is to reinstall Python and make sure that box is checked before clicking install — there’s no need to uninstall first, just run the installer again.
Running “python” opens Python 2 instead of Python 3 (macOS/Linux): This happens because many systems ship with an old Python 2 command already using the name “python.” The fix is simple: always type python3 explicitly instead of just python, which points to the version you actually installed.
The installer seems stuck or unresponsive: Installers occasionally hang if your antivirus software is scanning the file simultaneously, or if a previous installation attempt didn’t fully complete. Restarting your computer and trying the installer again resolves this in the vast majority of cases.
Permission errors during installation: On macOS and Linux, some installation steps require administrator (or “sudo”) access. If you see a permission-denied error, make sure you’re entering your account password when prompted, rather than skipping that step.
Common Questions Beginners Ask About Installing Python
Do I need to install anything else besides Python itself? To start learning, no — Python alone lets you write and run basic programs. You’ll likely want a proper code editor soon, which our guide to code editors for beginners covers in detail.
What if I already have Python 2 installed? Ignore it. Python 2 is no longer maintained or supported, and everything modern — tutorials, libraries, tools — assumes Python 3. Installing Python 3 alongside an existing Python 2 installation is completely safe; they won’t conflict as long as you use the correct command (python3) to be sure you’re running the right one.
Is it safe to reinstall Python if something goes wrong? Yes. Reinstalling Python is a routine, low-risk fix for most installation issues, and it won’t affect any code files you’ve already written and saved separately.
Quick-Reference Python Installation Guide
- Windows: download from python.org, and don’t forget to check “Add Python to PATH” during installation.
- macOS: download the official installer from python.org/downloads/macos, since the built-in system Python isn’t meant for development.
- Linux: check first with
python3 --version, then install via your package manager (likeapt) if needed. - Always use python3 — especially on macOS and Linux, to avoid confusion with any older system Python.
- Verify with a version check — a version number confirms a successful installation.
- Test with the interactive shell — type
python3thenprint("Hello, world!")to confirm everything works end to end.
Conclusion
Installing Python looks slightly different depending on your operating system, but the underlying goal is identical everywhere: get a working Python 3 installation, confirmed with a quick version check, so you can start writing real code. The most common hiccups — forgetting “Add to PATH” on Windows, or confusing the system Python with a proper installation on macOS — are easy to avoid once you know to watch for them.
With Python installed, the natural next step is picking a proper place to write your code. Our guide to code editors for beginners walks through exactly that, including how to set up VS Code with Python-specific support, so your editor actually understands the language rather than just treating your code as plain text.
In the next guide in this series, we’ll dig into variables and data types — the actual building blocks of every Python program you’ll write from here on out, starting with the exact concepts you’ll use in nearly every script.
Explore More Python for Beginners Guides →

Alex Carter is a senior software developer with years of hands-on experience building real-world applications. After watching countless beginners give up on programming simply because most tutorials assumed too much prior knowledge, Alex started Vandutz Academy to do things differently — breaking every concept down into clear, judgment-free, step-by-step lessons. When not writing, Alex is probably debugging someone else’s code (or their own).