Multi-Agent Systems and Workflow Orchestration / Start Here

Set up and check the course environment

Lesson 2 of 43. Open to read. No account needed.

What You Will Set Up

Every exercise in this course runs in one folder on your computer, ~/multi-agent-practice, with its own Python environment. In this lesson you create that folder, install the seven libraries the course uses at exactly the versions the lessons were tested with, make the course's shared kit package importable from every exercise, and run a script that checks everything and tells you what to fix. You will also learn to recognise the installation failures you are most likely to meet.

When you finish, the practice folder looks like this:

~/multi-agent-practice/
  .venv/      the course's Python environment (never removed by cleanup)
  kit/        shared code; lessons add one module at a time
  data/       course-written data files, added by later lessons
  <exercise>/ one folder per exercise, removed by that exercise's cleanup

Readiness Check

The course assumes you can already do the following. Try each one in a few minutes; the answers are in Answer and Reasoning. If several are hard, study Python first (for example with Python for AI and Machine Learning) before continuing.

  1. Write a function count_words(texts) that takes a dictionary of strings, such as {"a": "one two", "b": "three"}, and returns how many words each string has: {"a": 2, "b": 1}.

  2. A script ends with this traceback. Which line failed, and why?

    Traceback (most recent call last):
      File "report.py", line 7, in <module>
        print(totals["A-1001"])
              ~~~~~~^^^^^^^^^^
    KeyError: 'A-1001'
    
  3. What does json.loads return for each of these strings, or what goes wrong? '{"ok": true}', '[1, 2.5, null]', '"done"', "{'ok': true}".

  4. What does this print?

    from dataclasses import dataclass
    
    @dataclass
    class Ticket:
        ticket_id: str
        priority: int = 3
    
    print(Ticket("T-7"))
    

Terminal Basics

You will type commands in a terminal: the Terminal app on macOS, any terminal on Linux, and PowerShell on Windows. A few commands are all you need. pwd (print working directory) shows which folder you are in; ls (PowerShell: dir or ls) lists it; cd folder moves into a folder and cd .. moves up one; mkdir -p a/b creates folders, including missing parents (PowerShell's mkdir creates parents too). ~ means your home folder; PowerShell accepts ~ and also $HOME. Commands in this course are shown for macOS and Linux first, with the PowerShell form where it differs.

Choose a Python Version

The course supports Python 3.12, 3.13 and 3.14; it was planned on 3.13 and tested on all three. Check what you have:

python3 --version

On Windows, the Python launcher lists installed versions with py --list and runs one with, for example, py -3.13. If you have none of the three, install one from python.org (Windows and macOS) or your Linux distribution's packages.

Two cases need care:

  • Python 3.15 was released on 2026-10-09 (S32), but two packages that LangGraph needs, PyYAML and zstandard, do not yet publish ready-built versions ("wheels") for it (S33, S34). pip would try to compile them, and zstandard needs a C compiler, so the install usually fails. Use 3.14 or earlier for now.
  • Intel Macs and Windows on Arm are not supported. A security library the MCP SDK uses, cryptography, publishes no wheel for them (S06), so pip would try to build it from source.

Supported computers are Apple-silicon Macs with macOS 11 or later, Linux on x86_64 or arm64, and Windows 10 or 11 on x64. The course needs about 1 GB of free disk space and no graphics card, account or payment.

Exercise: Build the Environment

Goal: create the practice folder and environment, install the pinned libraries, make kit importable and pass check_setup.py.

Starting state: a supported Python and a terminal open in your home folder. Nothing else.

Effects: creates ~/multi-agent-practice with about 100 MB of libraries, downloaded once from the Python Package Index (PyPI). This is the only step in the core course that uses the network.

  1. Create the folders and move into the practice folder:

    mkdir -p ~/multi-agent-practice/kit ~/multi-agent-practice/data ~/multi-agent-practice/course-setup
    cd ~/multi-agent-practice
    

    PowerShell:

    mkdir ~/multi-agent-practice/kit, ~/multi-agent-practice/data, ~/multi-agent-practice/course-setup
    cd ~/multi-agent-practice
    
  2. Create the environment with a supported Python. Replace python3 with the version you chose if needed, for example python3.13:

    python3 --version
    python3 -m venv .venv
    

    PowerShell, using the launcher: py -3.13 -m venv .venv.

  3. Activate it. Activation makes python and pip in this terminal mean the environment's own copies:

    source .venv/bin/activate
    

    PowerShell: .venv\Scripts\Activate.ps1. If PowerShell refuses because running scripts is disabled, allow scripts you created for your own user with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser and try again (S23). Your prompt now starts with (.venv). Each new terminal needs this activation step again.

  4. Save this as requirements.txt in ~/multi-agent-practice/course-setup:

    pytest==9.1.1
    pydantic==2.14.1
    langgraph==1.2.16
    langgraph-checkpoint==4.3.0
    langgraph-checkpoint-sqlite==3.1.2
    langchain-core==1.6.12
    mcp==2.3.0
    

    Then move into that folder, install the list and check the result:

    cd ~/multi-agent-practice/course-setup
    python -m pip install -r requirements.txt
    python -m pip check
    

    The install takes one to five minutes, mostly downloading. pip check should print No broken requirements found. pip may also print a notice that a newer pip is available; it is harmless, and the course does not upgrade pip.

  5. Create the kit package. A folder becomes a Python package when it has an __init__.py file. Save this as kit/__init__.py in your practice folder:

    """Shared code for the Multi-Agent Systems and Workflow Orchestration course.
    
    Each module in this package is added by one lesson and not changed afterwards.
    """
    
  6. Save this as write_path_file.py in course-setup:

    """Make the kit package importable from any folder inside this environment."""
    import sys
    import sysconfig
    from pathlib import Path
    
    practice = Path.home() / "multi-agent-practice"
    if Path(sys.prefix).resolve() != (practice / ".venv").resolve():
        sys.exit("Activate ~/multi-agent-practice/.venv first, then run this again.")
    
    target = Path(sysconfig.get_path("purelib")) / "multi_agent_practice.pth"
    target.write_text(str(practice) + "\n")
    print(f"wrote {target}")
    print(f"Python in this environment now also looks for packages in {practice}")
    

    Run it:

    python write_path_file.py
    
  7. Save this as check_setup.py in course-setup:

    """Check the course environment and report what to fix."""
    import os
    import sys
    from importlib.metadata import PackageNotFoundError, version
    from pathlib import Path
    
    EXPECTED = {
        "pytest": "9.1.1",
        "pydantic": "2.14.1",
        "langgraph": "1.2.16",
        "langgraph-checkpoint": "4.3.0",
        "langgraph-checkpoint-sqlite": "3.1.2",
        "langchain-core": "1.6.12",
        "mcp": "2.3.0",
    }
    TRACING_VARIABLES = ["LANGSMITH_TRACING", "LANGSMITH_TRACING_V2", "LANGCHAIN_TRACING", "LANGCHAIN_TRACING_V2"]
    problems = []
    
    python = sys.version_info
    print(f"Python {python.major}.{python.minor}.{python.micro}")
    if not (3, 12) <= (python.major, python.minor) <= (3, 14):
        problems.append("use Python 3.12, 3.13 or 3.14")
    
    practice = Path.home() / "multi-agent-practice"
    inside = Path(sys.prefix).resolve() == (practice / ".venv").resolve()
    print(f"environment: {sys.prefix}")
    if not inside:
        problems.append("activate ~/multi-agent-practice/.venv first")
    
    for name, wanted in EXPECTED.items():
        try:
            found = version(name)
        except PackageNotFoundError:
            found = "missing"
        print(f"{name:28} {found}")
        if found != wanted:
            problems.append(f"{name} should be {wanted}")
    
    try:
        import kit
        print(f"kit importable from {Path(kit.__file__).parent}")
    except ImportError:
        problems.append("kit is not importable: write the path file")
    
    tracing = [name for name in TRACING_VARIABLES if os.environ.get(name)]
    print("tracing variables set:", ", ".join(tracing) if tracing else "none")
    if tracing:
        problems.append("unset " + ", ".join(tracing))
    
    if problems:
        print("NOT READY:")
        for problem in problems:
            print(" -", problem)
        sys.exit(1)
    print("READY")
    

    Run it:

    python check_setup.py
    

    Output (illustrative: your paths and Python patch version will differ):

    Python 3.13.0
    environment: /Users/you/multi-agent-practice/.venv
    pytest                       9.1.1
    pydantic                     2.14.1
    langgraph                    1.2.16
    langgraph-checkpoint         4.3.0
    langgraph-checkpoint-sqlite  3.1.2
    langchain-core               1.6.12
    mcp                          2.3.0
    kit importable from /Users/you/multi-agent-practice/kit
    tracing variables set: none
    READY
    

Success: the last line is READY. That means a supported Python, the course environment active, all seven libraries at the tested versions, kit importable, and no tracing variable set. If you see NOT READY, each line under it names one thing to fix; When It Goes Wrong explains them.

Why Seven Exact Versions

The == in each line pins an exact version. Agent libraries change quickly: version 2 of the MCP Python SDK, for example, renamed its main server class and added a new client (S09), so code written for one version can fail on the next. Pinning means your output matches the lessons. Five of the seven are libraries you will use directly: pytest to test agents, pydantic to check what agents pass to each other, LangGraph and its SQLite checkpointer for the framework module, and the MCP SDK (S01 to S04, S41). The other two, langgraph-checkpoint and langchain-core, are libraries LangGraph itself uses whose behaviour shows through in lessons (S45, S46). pip installs about 55 further packages they depend on, at versions within the ranges these seven allow.

How the Path File Works

Python finds packages by searching the folders listed in sys.path. Each environment has a site-packages folder for installed libraries; Python's sysconfig module calls it purelib (S78). When Python starts, it reads any file in that folder whose name ends in .pth and adds each line it contains to sys.path (S77).

write_path_file.py uses that rule:

target = Path(sysconfig.get_path("purelib")) / "multi_agent_practice.pth"
target.write_text(str(practice) + "\n")

It writes one line, the full path of your practice folder, into multi_agent_practice.pth inside the environment. From then on, any Python started from this environment can import kit, whichever exercise folder you are in. A Python outside the environment never reads that file, so it cannot see kit: the course's code stays in the course's environment. The check at the top of the script refuses to run unless the course environment is active, so the file cannot end up in the wrong Python by accident.

The alternative, setting the PYTHONPATH environment variable, would work only in terminals where you remembered to set it. The path file is written once and keeps working.

How check_setup.py Works

The script collects problems in a list instead of stopping at the first one, so one run tells you everything to fix.

  • sys.version_info gives the running Python's version; the comparison (3, 12) <= (major, minor) <= (3, 14) checks the supported range.
  • sys.prefix is the folder of the environment that is running the script. Comparing its resolved path with ~/multi-agent-practice/.venv shows whether the course environment is active.
  • importlib.metadata.version(name) reads an installed package's version without importing it, and raises PackageNotFoundError when it is not installed. Each version is compared with the pinned one.
  • import kit succeeds only if the path file works.
  • The four tracing variables are the ones the LangSmith client library (installed with LangGraph) reads to decide whether to send traces to LangSmith's service (S08). The course never sets them, so nothing is sent; the script reports them so you would notice if your terminal had them set from other work.
  • sys.exit(1) ends with a failure status when there are problems, so scripts and test tools can detect the failure as well as you.

When It Goes Wrong

What you seeCauseFix
python3: command not found (Windows: python opens the Microsoft Store)No Python on the pathInstall a supported Python; on Windows use the py launcher
The virtual environment was not created successfully because ensurepip is not availableDebian and Ubuntu package venv separatelyInstall the package the message names, for example sudo apt install python3.13-venv, then repeat step 2
... cannot be loaded because running scripts is disabled on this systemPowerShell's execution policyThe Set-ExecutionPolicy command in step 3
NOT READY: - activate ~/multi-agent-practice/.venv first and packages missingA different Python ran the script: the environment is not active in this terminalRun step 3 again in this terminal
Packages installed but check_setup.py says missingYou ran pip install instead of python -m pip install, and pip belongs to another PythonUse python -m pip, which always installs into the Python you name; python -m pip --version shows where
Errors building zstandard, PyYAML or cryptography, or No matching distribution foundPython 3.15, an Intel Mac or Windows on ArmUse Python 3.12 to 3.14 on a supported computer
kit is not importable: write the path fileStep 6 not run, or run in another environmentActivate the environment and run write_path_file.py again
tracing variables set: LANGSMITH_TRACINGSet in your shell by other workRemove it for this course: unset LANGSMITH_TRACING (PowerShell: Remove-Item Env:LANGSMITH_TRACING)

For example, with tracing switched on, the end of the report reads:

tracing variables set: LANGSMITH_TRACING
NOT READY:
 - unset LANGSMITH_TRACING

Your Turn: Diagnose Three Failures

Each transcript below comes from a learner's terminal. For each one, name the cause and the fix before reading the answer.

  1. $ pip install -r requirements.txt
    Successfully installed ... mcp-2.3.0 ...
    $ python check_setup.py
    mcp                          missing
    
  2. $ python --version
    Python 3.15.0
    $ python -m pip install -r requirements.txt
    ...
    Building wheel for zstandard (pyproject.toml) ... error
    
  3. $ python check_setup.py
    ...
    kit is not importable: write the path file
    $ ls ~/multi-agent-practice/kit
    __init__.py
    

Reset and Clean Up

The environment, kit and data stay for the rest of the course. Only the exercise folder can go. From the practice folder, this removes it after checking where you are:

cd ~/multi-agent-practice
case "$PWD" in */multi-agent-practice) rm -rf course-setup ;; *) echo "not in the practice folder" ;; esac

PowerShell:

cd ~/multi-agent-practice
if ((Get-Location).Path -like "*multi-agent-practice") { Remove-Item -Recurse -Force course-setup }

If your environment is ever broken beyond repair, remove only .venv the same way and repeat steps 2 to 7: kit and data are unaffected, and the path file is written into the new environment by step 6. You can keep check_setup.py somewhere safe and run it at the start of any lesson.

Check Your Understanding

  1. Why does the course say python -m pip install rather than pip install?
  2. You open a new terminal tomorrow and run an exercise script. It fails with ModuleNotFoundError: No module named 'kit'. What is the most likely cause, and why does it not mean the path file is missing?
  3. Why would writing your practice folder's path into the PYTHONPATH variable be a weaker solution than the path file?

Answer and Reasoning

Readiness check.

  1. One solution:

    def count_words(texts):
        return {key: len(value.split()) for key, value in texts.items()}
    

    split() with no argument splits on any run of whitespace.

  2. Line 7, print(totals["A-1001"]): the dictionary totals has no key "A-1001". The last line names the error type and the missing key; the line above it points at the failing expression.

  3. {'ok': True} (JSON true becomes Python True); [1, 2.5, None]; 'done' (a JSON string on its own is valid); the last raises json.JSONDecodeError, because JSON requires double quotes around names.

  4. Ticket(ticket_id='T-7', priority=3): a dataclass generates a readable representation with each field, and priority takes its default.

Your turn.

  1. pip on the path belongs to a different Python (often the system one), so the packages went there. Activate the environment and use python -m pip install -r requirements.txt.
  2. Python 3.15 has no ready-built zstandard wheel yet, so pip tried to compile it and failed. Create the environment with Python 3.12, 3.13 or 3.14.
  3. The package folder exists, but the path file is missing or in another environment: Python does not search the practice folder. Activate the course environment and run python write_path_file.py.

Understanding check.

  1. python -m pip runs the pip that belongs to that exact Python, so the packages go where that Python will look for them. A bare pip may belong to another installation.
  2. The environment is not active in the new terminal, so python is a different Python that never reads the course environment's path file. Activate the environment (step 3); the path file is still there.
  3. PYTHONPATH applies only in terminals where it is set, and it applies to every Python started there, not just the course environment. The path file lives inside the environment, works in every terminal once it is activated, and affects nothing else.

References

38 more lessons in the full course

Course access opens every lesson and adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

Get the full course

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy