Installing Python: Setting Up Your Workshop

Installing Python: Setting Up Your Workshop in Python: Before you can run a single line of Python, your computer needs the Python interpreter — the program…

Concept Explanation

Before you can run a single line of Python, your computer needs the Python interpreter — the program that reads your .py files and executes them. Many systems ship with a version already, but it is often old and sometimes reserved for the operating system's own use, so installing your own is the safer path.

Which version?

Always install the latest stable Python 3.x. Python 2 reached end of life in 2020 and receives no security fixes. If a tutorial uses print "hello" without parentheses, it is Python 2 and you should ignore it.

Installing by platform

PlatformRecommended methodNotes
WindowsInstaller from python.orgTick "Add python.exe to PATH" on the first screen
macOSbrew install pythonThe pre-installed Python is for system use — don't touch it
Linuxsudo apt install python3 python3-pipMost distributions include it already

Verifying the install

Open a fresh terminal and run:

python --version

You should see something like Python 3.12.4. On macOS and Linux you may need python3 instead — those systems keep python pointing at the legacy version, or leave it undefined entirely.

Check the package installer too, since you will need it constantly:

pip --version

The interactive shell

Typing python with no filename drops you into the REPL (Read-Eval-Print Loop) — a prompt where each line runs immediately:

>>> 2 + 2
4
>>> name = "Ada"
>>> print(f"Hello, {name}")
Hello, Ada
>>> exit()

This is the fastest way to test a small idea. Nothing you type here is saved, which makes it perfect for experiments and useless for real programs — those belong in files.


Common Mistakes

  1. Forgetting to tick "Add to PATH" on Windows. The single most common setup failure. Your terminal responds with 'python' is not recognized even though Python is installed. Fix: re-run the installer, choose Modify, and enable it — no need to uninstall.
  2. Opening a terminal that was already running. A terminal reads PATH when it starts, so a window opened before the install will never see Python. Close it and open a new one.
  3. Following a Python 2 tutorial. If the code says raw_input() or bare print "x", it predates 2020. It will not run.
  4. Installing from the Microsoft Store by accident. That build sandboxes file access and confuses some tooling. Prefer the python.org installer.
  5. Assuming python and python3 are the same. On macOS and many Linux systems they are different binaries pointing at different versions.

Best Practices

  • Use the official installer or your system package manager. Both are signed and keep Python on a normal upgrade path.
  • Learn whether your machine wants python or python3 and use it consistently. Mixing them is a reliable source of "but I installed that package" confusion.
  • Never modify or delete the system Python on macOS or Linux. Parts of the OS depend on it.
  • Install pip alongside Python. The official installers bundle it; some Linux distributions split it into a separate package.
  • Check the version before debugging anything. A surprising share of "this code doesn't work" turns out to be an unexpected interpreter version.

Practice Exercises

  1. Confirm the Install: Run python --version (or python3 --version) and note the exact version. Confirm the major version is 3.
  2. REPL Arithmetic: Open the interactive shell and evaluate 7 / 2, then 7 // 2, then 7 % 2. Note how the three results differ, then exit with exit().
  3. Locate the Interpreter: Run where python on Windows or which python3 on macOS/Linux to see exactly which file runs when you type the command.