Loading...

Python essentialsGetting Started

Setup: installing Python & an editor

5 min lesson

Next
  • 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.
Keep in mind
  • 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 IDLE

An 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 --version

Prints 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

TaskWindowsmacOS / Linux
Check Python versionpython --versionpython3 --version
Open Python REPLpythonpython3
Run a scriptpython main.pypython3 main.py
Install a packagepip install namepip3 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 found

Use 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 Windows

Use instead

python --version

On 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.
Previous
Next