Setting Up Without the Ceremony
The usual first step in a Python tutorial is an hour of installer screenshots. Run one line without installing anything, and see the same interpreter everyone else is using.
The usual first step in a Python tutorial is an hour of installer screenshots. Most of that hour is unnecessary — check what is already on your machine before you install anything.
The one thing you actually need
You need exactly one thing to start: a working Python interpreter you can reach from a terminal. You do not need an editor with plugins, a virtual environment, or a project folder yet — those matter later, once you have more than a few lines to organise.
Type python3, specifically — not the bare python. Python 2 reached its end of life in January 2020, and on some older Linux and macOS installs, the unqualified python command still quietly points at the version nobody should be writing new code against. Everything in this track, and almost everything written since 2020, targets Python 3.
Most Mac and Linux machines ship with Python already installed. Pick what you are sitting at.
$ python3 --version# Python 3.12.x $ python3If that version line printed, you are done — skip ahead. If it said “command not found”, install Python 3 from python.org and run it again.
A terminal that already has it
Typing python3 (or py on Windows) with nothing after it drops you into the interactive interpreter, usually called the REPL — read, evaluate, print, loop. Type an expression, press return, and it is evaluated immediately.
$ >>> 2 + 2$ 4$ >>> "hello".upper()$ 'HELLO'Everything after the >>> was typed by you. Everything on the line below it is Python printing the result back, unprompted — the REPL shows you the value of every expression you enter, which is why it is the fastest way to check a small idea.
Not every line prints something. An assignment runs silently, because storing a value and evaluating one are different actions — Python only ever prints the second kind. Name the variable on its own line afterwards, and it prints exactly like anything else would.
$ >>> x = 5$ >>> x$ 5Leave the REPL with exit(), or Ctrl+D on macOS and Linux, Ctrl+Z then Enter on Windows.
Where a file stops and a script begins
The REPL is for trying something out. A .py file is for keeping it. Save a few lines in a file named hello.py, and run the file itself rather than typing its contents by hand:
print("Hello, world!")$ python3 hello.py$ Hello, world!Nothing you type into the REPL is saved anywhere once you close it. Every program in the rest of this track assumes you are working in a file, not the REPL, for exactly that reason.
Run the command from the same folder the file is saved in, or point at it with a path — python3 scripts/hello.py works one directory up. Get the path wrong and Python says so plainly: can't open file 'hello.py': No such file or directory is a path problem, not a Python problem, and no amount of fixing your code will touch it.
Why every tutorial tells you to make one
Every package you install lands in one place by default: the interpreter itself. That is fine until a second project needs a different, incompatible version of the same package — which happens more often than it sounds like it should. A virtual environment is a private copy of the interpreter and its installed packages, scoped to a single project folder, so two projects never fight over the same shared copy of anything.
- 1
Create one, inside your project folder
One command makes a folder holding a private copy of Python and pip, separate from the system installation.
- 2
Activate it
The command differs by platform. Once active, every python3 and every pip install you run uses this private copy, not the system one.
- 3
Install into it
From here on, pip install only ever affects this one project.
$ python3 -m venv .venv$ source .venv/bin/activate# the prompt now starts with (.venv)$ pip install requestsActivate with source .venv/bin/activate.
Activate with .venv\Scripts\activate.
Leave it with deactivate, typed on its own — nothing about a virtual environment is permanent. It is a folder you can delete and recreate at any time, which is exactly why the advice to make one is so unconditional.
Key takeaways
- You need one thing to start: a Python interpreter reachable from a terminal, as python3.
- The REPL (python3 with nothing after it) evaluates expressions immediately and prints the result — but an assignment runs silently.
- Nothing typed into the REPL is saved. Real programs live in .py files, run with python3 <filename>.py.
- A virtual environment is a private copy of the interpreter and its packages, scoped to one project folder.
- Activate a virtual environment before installing anything, or every package lands in the shared system interpreter instead.
Quick check
Answer these to unlock the next chapter — 3 of 4 to pass. You can retake it anytime.
Answer every question to check.
Make a free account to read on
Every chapter is free — an account is how your progress, XP, and streak follow you from your laptop to your phone, and how you show up on the leaderboard. No payment, no trial.