CurriculumWeek 0 · Setup weekOptional — installing Python locally for a head start
Lesson 00.02 · ~20 min read

Optional — installing Python locally for a head start

If you want to install Python 3.11+ and VS Code on your own machine before live sessions, here is the gentle path.

By Kelvin AmoabaUpdated May 12, 2026Prerequisite: 00.01

What you're doing on this page

On this page you are going to install Python onto your own computer and run your first file from it. This lesson is optional. If you skip it, nothing breaks and you are not behind. For the first two weeks of the course we use Google Colab, a website that runs Python for you. At the end of Week 2 I will install Python with the whole cohort on a live call, step by step. So do not stress.

Who is this page for? The impatient ones. The students who like to poke at things on their own before being shown. If that's you, pull up a chair. If not, close this tab, finish the Colab exercise from the other lesson, and I will see you on the live call.

What does "installing locally" even mean?

When you use Colab, the work happens on Google's computer sitting in a server room somewhere. You type code in your browser, their machine runs it, and the answer comes back to your screen. You never touched Python — it lives over there.

"Installing locally" means putting Python on your own laptop, so the work happens on the machine in front of you, no internet needed. It's the difference between borrowing a friend's stove to cook and having a stove in your own kitchen. Both cook the food. One is more convenient once you live there.

You need two separate programs. One is Python itself — the language, the engine that actually reads your code and runs it. The other is VS Code, a text editor built for writing code. A text editor is a fancier version of Microsoft Word, except instead of essays you write programs in it. VS Code colours your code, helps you spot mistakes, and has a window built in for running things. These two programs are separate. Installing one does not install the other. You need both.

Skip this lesson if...

  • You are nervous about installing things on your computer. Wait for the live call. I will be on screen with you.
  • Colab is working fine and you are getting through the Week 1 exercises. There is no prize for rushing.
  • You only have thirty minutes right now. This will take an hour the first time, longer if something goes wrong.

Keep going if you have a full evening, you enjoy figuring things out yourself, and a broken laptop will not ruin your week.

A two-minute crash course on the terminal

I keep saying "terminal" so let me stop and explain it, because if you have never opened one it sounds scary.

A terminal is a window on your computer where you talk to it by typing instead of clicking. That's the whole thing. You type a sentence, press Enter, and the computer does what you said. The sentences you type are called commands — short instructions the computer understands, like "show me what version of Python you have" or "run this file."

You already use your computer by clicking icons. The terminal is the same computer, just answering you through typing. Some things are much faster this way, which is why programmers use it all day. On macOS the terminal is an app called Terminal. On Windows it's called Command Prompt (or PowerShell — either works). On Linux you already know.

When I show a grey box below, that is a command you type into your terminal and press Enter.

Installing on macOS

  1. Open your browser and go to python.org/downloads. There's a big yellow button offering the latest Python 3. Click it and a file downloads — something like python-3.12.pkg. Open that file. The installer walks you through: Continue, Continue, Agree, Install. Type your Mac password when it asks. Wait for it to finish.

  2. Go to code.visualstudio.com and download VS Code. Open the downloaded file and drag the VS Code icon into your Applications folder when it asks. Open it from Applications like any other app.

  3. Inside VS Code, look at the left sidebar. You'll see a small icon that looks like four little squares with one floating off — that's Extensions. Click it. Type Python into the search bar. The first result should be one published by Microsoft with millions of downloads. Click Install. That extension teaches VS Code how to understand Python files.

  4. Now check Python actually got installed. Open your terminal: press Cmd + Space, type Terminal, press Enter. A window with a blinking cursor appears. Type:

python3 --version

If you see something like Python 3.12.4, the install worked. If you see an error saying the command was not found, leave a note in the cohort channel.

  1. Now run a real file. In the same terminal, type these three commands, pressing Enter after each:
mkdir pysprout
cd pysprout
code hello.py

The first makes a new folder called pysprout. The second moves you into it. The third tells VS Code to open a new file called hello.py inside it. VS Code pops up with an empty file. Type one line:

print("Hello from a real file.")

Save the file with Cmd + S. Go back to your terminal and type:

python3 hello.py

Your message appears in the terminal. That's it — you wrote a file on your own machine and your own machine ran it.

Installing on Windows

Windows has one trap door that catches almost everyone the first time. Read this paragraph twice.

When the Python installer opens, the very first window has a checkbox near the bottom that says "Add python.exe to PATH" (sometimes "Add Python 3.x to PATH"). It is off by default. You must tick it before clicking Install. PATH is a list your computer keeps of where to look for programs when you type their name. If Python is not on that list, your terminal will not know where to find it, and every command will fail even though Python is installed. Tick the box.

  1. Go to python.org/downloads and download the Windows installer. Open the file.

  2. Tick "Add python.exe to PATH" at the bottom of the first window. Click "Install Now". Wait for it to finish.

  3. Open the terminal: press the Windows key, type cmd, press Enter. A black window with a blinking cursor opens. Type:

python --version

You should see Python 3.12.x or similar. On Windows the command is python, not python3. Small difference, but it matters.

  1. If instead you see "'python' is not recognized as an internal or external command", the PATH checkbox was missed. Don't panic. Go to Settings → Apps, find Python in the list, uninstall it, and run the installer again — ticking the box this time. Five minutes of redoing it beats an hour of fixing PATH by hand.

  2. Install VS Code from code.visualstudio.com. Run the installer, accept the defaults. Open VS Code, click the Extensions icon (four squares) in the left sidebar, search Python, install the one from Microsoft.

  3. In VS Code, click File → Open Folder and pick or create a folder somewhere sensible (Documents is fine). Inside VS Code, create a new file called hello.py. Type:

print("Hello from a real file.")

Save it. Open VS Code's built-in terminal: Terminal → New Terminal at the top of the window. A panel pops up at the bottom. Type:

python hello.py

Your message prints. You're done.

Installing on Linux

If you are using Linux, you probably already have Python. Open a terminal and check:

python3 --version

If you see version 3.11 or higher, you are good. If not, use your package manager. On Ubuntu or Debian:

sudo apt update
sudo apt install python3 python3-pip

On Fedora it's sudo dnf install python3. On Arch, sudo pacman -S python. Install VS Code from your distro's package manager or from code.visualstudio.com, then add the Microsoft Python extension and run a hello.py file the same way as above.

How to know it actually worked

Three things tell you the install is real:

  • Typing python3 --version (or python --version on Windows) shows a version number 3.11 or higher.
  • VS Code opens when you click it, and the Microsoft Python extension shows up in the Extensions list.
  • You can save a file called hello.py with print("Hello from a real file.") inside it, run python3 hello.py (or python hello.py on Windows), and see your message print.

If all three are true, well done. You are ahead. You will still do Week 1 in Colab with the rest of the cohort, but you've removed a future headache for yourself.

Your exercise

Make a fresh file on your computer called hello.py. Inside it, write a short program that prints your name and your home town on two separate lines. Save the file. Open your terminal, go into the folder where you saved it (using cd foldername), and run it with python3 hello.py (or python hello.py on Windows). You should see both lines printed back.

If that works, you have a real local Python setup. Take a screenshot of the terminal showing your output and keep it — you'll want to remember this moment later.

Common slip-ups

  • Forgetting to tick the PATH box on Windows. I warned you. If python --version fails, this is almost always why. Uninstall, reinstall, tick the box.
  • Typing python on macOS instead of python3. On Mac, the command is python3. Plain python may point to an old version or to nothing at all. Use python3.
  • Running the file from the wrong folder. If python3 hello.py says "No such file or directory," your terminal is not in the folder where hello.py lives. Use cd foldername to move in. Use ls (macOS/Linux) or dir (Windows) to see what's in the current folder.
  • Saving the file with the wrong name. A file called hello.py.txt is not a Python file. The name must end in exactly .py. On Windows, turn on "File name extensions" in File Explorer so you can see the real ending.
  • Closing the terminal mid-install. Let installers finish. They look frozen sometimes. Give them a minute.

If you get stuck, drop a message in the cohort channel: your operating system, the exact command you typed, and a screenshot of the error. With those three things I can usually unstick you in one reply. And if today isn't the day — close the laptop, walk away, and meet me on the live call. We'll do it together.

Resources

★ recommended