Setup: installing Python & an editor
5 min lesson
- Setting up means installing Python on your computer and choosing a program (editor) to write code in.
- You need this before you can run any Python program, so it is the first practical step.
- Think of it like setting up a kitchen before cooking: the stove is Python, and your counter is the editor.
- Python is the interpreter that runs your code; an editor is a text program made for writing code, with colors and helpful tools.
- Download Python from python.org, run the installer, and on Windows tick "Add Python to PATH" so you can run it from any folder.
- A good beginner editor is VS Code or IDLE (which comes with Python); both are free and simple to start.
- After installing, open a terminal and type python3 --version (or python --version on Windows) to confirm it works.
- A real use: once set up, you can write and run scripts from any folder on your computer.
- This connects to the next lesson, where you will write and run your first program.
- Install Python from python.org and tick "Add Python to PATH" on Windows.
- Choose a simple editor like VS Code or IDLE to write code comfortably.
- Check your install with python3 --version in a terminal.
- If something fails, reinstall carefully and read the messages; setup troubles are common and fixable.
Breaking it down
Python installer
python-3.x.x.exe (Windows)This installs the Python interpreter on your computer. Without it, your computer cannot understand Python code.
PATH option
Add Python to PATH (checkbox)This lets you type python in any terminal folder. Without it, you must type the full path to Python every time.
Editor
VS Code or IDLEAn editor is where you type and save .py files. It adds colors and simple helpers. Without one, you could use Notepad, but it is less comfortable.
Version check
python3 --versionPrints the installed Python version, like Python 3.12.1. If you see an error, Python is not installed or not on PATH.
Common setup commands
| Task | Windows | macOS / Linux |
|---|---|---|
| Check Python version | python --version | python3 --version |
| Open Python REPL | python | python3 |
| Run a script | python main.py | python3 main.py |
| Install a package | pip install name | pip3 install name |
A helpful analogy
Setting up is like preparing a kitchen before cooking. Python is the stove that does the cooking, the editor is your clean counter where you prepare ingredients, and the terminal is the door you use to tell the stove to start. Without any of these, cooking (running code) is awkward or impossible.
Nesting rules
- 1.Install Python before installing editor extensions that depend on it.
- 2.On Windows, always tick "Add Python to PATH" during install to avoid terminal errors.
- 3.Keep your project files in one folder so the terminal can find them easily.
Common mistakes
Forgetting to add Python to PATH on Windows
Avoid
'python' is not recognized // command not foundUse instead
Reinstall and tick "Add Python to PATH"Without PATH, the terminal cannot find the python command. Reinstalling with the checkbox fixes it.
Typing python3 on Windows
Avoid
python3 --version // may fail on WindowsUse instead
python --versionOn Windows the command is usually python, not python3. Using the wrong name gives a 'not found' error.
Quick tips
- •Write down the exact version you installed in case you need help later.
- •Open a new terminal after installing so the PATH change takes effect.
- •Try running python3 --version right away to confirm success.
- •If unsure, start with IDLE: it is simple and comes with Python.