Skip to content
Happy Programming Guide
Start learning
Python

How to Install Python (and Check It Actually Worked)

Step-by-step Python installation for Windows, macOS and Linux, plus how to confirm it worked and fix the "python is not recognised" error.

Installing Python takes about five minutes. Most of the trouble people hit comes from one checkbox on Windows, so this guide points at it clearly.

Before you install: do you need to?#

If you only want to try the language for an hour, use a browser-based Python editor. You need a local install once you want to work with your own files, install packages, or use an editor like VS Code.

Windows#

  1. Go to the official Python website and download the latest Python 3 installer for Windows.
  2. Run it. Tick “Add python.exe to PATH” on the first screen. This single checkbox causes most beginner problems when it is missed.
  3. Choose “Install Now”.
  4. Open a new terminal window (PowerShell or Command Prompt) and check it.
Terminal
python --version

You should see something like Python 3.12.4.

macOS#

macOS ships with an old Python that you should leave alone. Install your own:

  • Simple: download the macOS installer from the official Python site and run it.
  • With Homebrew: brew install python

Then check:

Terminal
python3 --version

On macOS you usually type python3 and pip3 rather than python and pip.

Linux#

Most distributions include Python 3 already. If not:

Terminal
sudo apt update
sudo apt install python3 python3-pip
python3 --version

Confirming everything works#

Three quick checks:

Terminal
python --version
pip --version
python -c "print(2 + 2)"

The last one should print 4. If all three work, you are done.

Why python and python3 both exist#

When Python 2 and 3 were both common, systems used python for the old one and python3 for the new. Python 2 is retired now, but the naming stuck on macOS and Linux. On Windows, python and py both point at Python 3.

If one command errors, try the other before assuming the install failed.

Installing a package#

Terminal
pip install requests

If pip is not found, use python -m pip install requests, which works whenever Python itself does.

Questions people ask#

Which version should I install?

The latest stable Python 3 release is right for learning. Only pin an older version if a specific tool you need requires it.

Do I need Anaconda?

Only if you are heading into data science, where it bundles the scientific packages for you. For general learning it is a large download you do not need.

My editor cannot find Python even though the terminal can

Editors keep their own interpreter setting. In VS Code, press Ctrl+Shift+P, run “Python: Select Interpreter”, and pick the version you just installed. See VS Code setup for beginners.

Can I have two versions installed?

Yes. On Windows, py -3.11 runs a specific version. Beyond that, virtual environments keep each project’s packages separate.

Where to go next#

Next lessonYour first Python program

Keep reading

Keep going — pick your next guide

The fastest way to improve is to read one guide, then build the thing it describes. Start with the basics, or jump straight to a project.

Ask a question or share what worked

Your email address will not be published. Required fields are marked *