0.2 · Installing Python & an editor (VS Code / PyCharm)

Getting started

0.2Installing Python & an editor (VS Code / PyCharm)

Goal: Install Python, check the python command and set up the editor — a workstation ready for the whole guide.
Estimated time: 12 min · self-paced reading · If you only have 5 min: read “The essentials in 30s” + the diagram.

The essentials in 30 seconds

  • Two tools, two roles: the interpreter runs, the editor writes — install Python from the official site, version 3.
  • On Windows, check PATH: "Add Python to PATH" makes the python command usable everywhere — forgetting it is trap #1.
  • Check with the trio: the python command, the pip command, then a .py file run from VS Code.

Running mini-case — Nabil sets up his workstation in Algiers

Nabil, a junior data analyst in Algiers, receives a blank laptop and must prepare his Python workstation before any calculation. He installs the interpreter from the official site, checks the PATH option on Windows so the python command answers everywhere, checks in the terminal that the language and the installer respond, then installs VS Code with the Python extension and selects his interpreter. He creates a working folder and a test.py file: three green checks, his workshop is ready to analyze his first sales.

Self-contained case for this section: it returns in the lesson, diagram, script and 48h challenge of section 0.2.

1. Installing without mistakes

Download Python from the official site, in version 3 (never version 2, discontinued), and on Windows check "Add Python to PATH" before clicking Install. PATH is the list of folders where the system looks for programs: checking it makes the python command usable everywhere in the terminal. Check at once with python --version (or python3 --version depending on the system): if the terminal answers, the interpreter is correctly installed. Nabil checks before going further: no answer, no next step.

2. VS Code: the forgiving editor

VS Code (free) with the Python extension offers highlighting, one-click run, built-in terminal and debugging. After installation, select the interpreter that will run your code — that is what counts, not the editor. The PyCharm alternative (free Community edition) is a full IDE appreciated for large projects, but VS Code, lighter, is enough to get started. Nabil installs the extension, selects his interpreter and opens his working folder in the editor.

3. The verification trio

Three green checks validate the workstation: the python command (the language answers), the pip command (the package installer answers — it will add the ecosystem libraries), and a .py file run from VS Code. This trio isolates any future failure: if a command stops answering, you know exactly which building block is at fault. Nabil creates test.py in his working folder and runs it: his development workshop is ready for the next section.

Common misinterpretation: "The editor runs code on its own, and checking PATH is a detail". No. The editor only writes and calls: it is the selected interpreter that actually runs the code — hence the importance of choosing it explicitly in VS Code. And PATH is not a detail: without it, the system cannot find the python command and the terminal answers "not recognized". If you forgot it, rerun the installer in Modify mode to add the option instead of stacking installations that get mixed up.
The ready workstation Official Python + PATH, VS Code + extension, verified trio: three green checks. Python + PATHThe interpreter answers everywhere+VS Code + extensionWrite, run, debug+Verified triopython, pip, first .py "Add to PATH" checked: #1 forgotten step on Windows; one clean installation.
Official Python + PATH, VS Code + extension, verified trio: three green checks.
Text version of the diagram (SEO / screen readers / translation): 1) Nabil, a junior data analyst in Algiers, installs the Python interpreter from the official site and checks the PATH option so the python command answers everywhere. 2) He installs VS Code with the Python extension and selects the interpreter that will run his code. 3) He validates with the trio: python command, pip command, then an executed test.py file. Lesson: interpreter + editor + verification, one clean installation, no old version.

🔎 Concrete example — 🔎 Concrete example — Full check

The trio proving Nabil's workstation is ready.

# In the terminal (Windows: PowerShell, macOS/Linux: Terminal):
# $ python --version
# $ pip --version
# Then in VS Code: Python extension installed, interpreter selected
print("Nabil's workstation: ready")

Reading: Nabil types both commands: if the terminal answers, language and installer are aligned; the script confirms execution from the editor.

Lesson: on any future failure, replay this trio to isolate the faulty building block.

Section vocabulary

Python interpreter
The program that reads and runs your code. You call it with the python command (or python3 depending on the system).

Simple example: Nabil types python in the terminal and the interpreter answers.

What it is not: the editor, which only writes code.

Reflex: when in doubt, first check that python answers.

PATH
List of folders where the system looks for programs. Checking "Add Python to PATH" makes the python command usable everywhere.

Simple example: Nabil checks the option in Algiers and runs python from any folder.

What it is not: a password or a decorative option.

Reflex: "python not recognized" = think PATH first.

Editor / IDE
Software for writing code, with highlighting and tools. VS Code is a very popular extensible editor; PyCharm is a dedicated IDE.

Simple example: Nabil writes test.py in VS Code instead of Notepad.

What it is not: the program running code instead of the interpreter.

Reflex: write in the editor, run with the interpreter.

VS Code
Very widespread free editor. With the Python extension, it offers execution, autocompletion and debugging.

Simple example: Nabil installs the Python extension and selects his interpreter.

What it is not: a competing programming language.

Reflex: after installation, explicitly select the interpreter.

Terminal
Window where you type text commands. On Windows: PowerShell; on macOS and Linux: the Terminal.

Simple example: Nabil types python --version there to check his installation.

What it is not: a text box in a web page.

Reflex: check each installation with a command, not by eye.

In practice — In practice — Cleanly installing Python and VS Code

  1. Download Python from the official site (version 3). During the Windows installation, you MUST CHECK "Add Python to PATH" before clicking Install.
  2. Check in a terminal: type "python --version" (or "python3 --version") — the displayed number proves the interpreter answers.
  3. Install VS Code, then in the Extensions tab, install the "Python" extension and select your interpreter.
  4. Create a working folder, open it in VS Code, and create a "test.py" file to confirm everything works in the next section.
Python and VS Code are installed, the python command answers in the terminal: your development workshop is ready.

Script ready to say — announcing your workstation is ready (30 s)

"Workstation ready: Python installed from the official site with the PATH option, python and pip answer in the terminal, VS Code with the Python extension and the selected interpreter. My test.py runs — like Nabil, I can start my first program."

Say while showing the answering terminal and the test.py file run in VS Code.

Copy-paste template — validating your workstation

# test.py — validating Nabil's workstation
import sys
print("Nabil's workstation: OK")
print(sys.version)
print("If these 2 lines display, the interpreter is responding.")

Forgotten PATH

Terminal answers "not recognized": rerun the installer, choose Modify and check the PATH option instead of blindly reinstalling.

python3 command

If python does not answer but python3 does, use python3 and pip3: your system distinguishes both names for the same installation.

Shared workstation in Algiers

Nabil notes the selected interpreter on the shared workstation card: everyone checks the selection on arrival, without stacking installations.

Mixed-up recovery

Two installations getting mixed up: uninstall the old version, keep one clean installation, then replay the verification trio.

Caution: Only download Python from the official site and refuse version 2 (discontinued). On Windows, forgetting "Add Python to PATH" is failure #1: if "python" is not recognized, rerun the installer in Modify mode to check the option rather than stacking installations.

✓ Best practices

  • Install from the official site, in a recent version 3.
  • Check PATH on Windows.
  • Select the interpreter in VS Code.

✗ Common pitfalls

  • Installing Python 2 (long discontinued).
  • Forgetting PATH ("python not recognized").
  • Stacking installations that get mixed up.

Key takeaways

  • Two tools: the Python interpreter (runs) + an editor like VS Code (writes) — the editor runs nothing on its own.
  • Trap #1 on Windows: forgetting to check "Add Python to PATH" during installation.
  • Always check the installation with the python command and the pip command.
  • VS Code + Python extension = free, professional environment, with the interpreter selected.

48h challenge — apply tomorrow

Install the workstation like Nabil, run the test.py template, and note what each command of the trio answers you.

Section exit checklist
  • The python and pip commands answer in my terminal.
  • VS Code has the Python extension and the interpreter is selected.
  • My test.py runs: my workshop is ready.
Self-rating 1-5: do I replay the trio before coding when in doubt?Self-rating 1-5: do I have one clean installation, with no mixing?

Frequently asked questions

"python" is not recognized in the terminal, what should I do?

It is almost always the forgotten "Add Python to PATH". Easiest: rerun the installer, choose "Modify" and check the PATH option; or reinstall with it checked. Also try the "python3" command (or "py" on Windows) depending on your system.

Should I use VS Code or PyCharm?

Both are excellent and free (PyCharm in Community edition). VS Code is lighter and versatile, ideal to get started; PyCharm is a full IDE appreciated for large projects. Start with VS Code.

Check your understanding

On Windows, which forgotten step causes "python is not recognized"?

Additional resources (optional, to go further)

Level 0 examFresh, harder questions to test what you've learned