AI EngineeringZero to ProductionHome·About·Contact
Getting Started · Your workspace

Using VS Code for This Course

One place to learn the exact setup you'll use for every chapter, lab, and project: how to open the course, run Python and the build labs, manage virtual environments, keep API keys safe, and use the Claude / Anthropic VS Code extension as your AI pair-programmer. Do this once and every later step just works.

⏱️ ~30 min🧰 one-time setup💻 VS Code + Python 3.10+⚙️ copy-paste config🎯 Start here
Why this page is firstEvery chapter's labs and all 15 projects assume you can open a terminal, activate a virtual environment, and run python / pytest. This page sets that up once. If you've never used VS Code, follow it top to bottom; if you have, skim the environment and extension sections — those trip people up most.

By the end of this page you will

  • Have VS Code, the Python extension, and the Anthropic extension installed and working.
  • Know how to open a project folder and use the integrated terminal.
  • Create and activate a per-project virtual environment — and know why the terminal prompt changes.
  • Install all course dependencies into that venv from code/requirements.txt in one command.
  • Store your API key safely (never in code) and confirm it's picked up.
  • Use the Anthropic extension to explain, generate, and debug code as you work through the course.
  • Pin the interpreter with a .vscode/settings.json so it's remembered, and (macOS/Linux) auto-activate the venv by folder.
  • Recognise and fix the classic traps: wrong interpreter, the .code-workspace override, and cloud-sync + venv problems.

1 · Install VS Code and the extensions

You need three things: the editor and two extensions. Install in this order.

Example code for learning — review, test, and adapt it before running against real or production systems. Commands can create, change, or delete resources. See the Terms & Disclaimer.
1 · Install
  1. VS Code — download from code.visualstudio.com and install for your OS.
  2. Python extension (Microsoft) — open the Extensions view (Cmd/Ctrl+Shift+X), search "Python", install the one by Microsoft. This gives you interpreter selection, the run button, and test integration.
  3. Anthropic extension — in the same Extensions view, search "Claude" / "Anthropic" and install the official extension. This is your in-editor AI assistant (you've already configured it — the next sections show how to use it for the course).
Optional but handyAlso install "Jupyter" (Microsoft) if you like running code in notebook cells, and "Even Better TOML" / "YAML" for editing config files. None are required for the course.

2 · Open the course / a project folder

VS Code works on a folder (your "workspace"), not loose files. Always open the folder that contains the code you're working on.

2 · Open a folder
  1. File → Open Folder… and pick your working directory (for a project lab, the project folder you create — e.g. content-assistant/).
  2. Or from a terminal already in that folder: code . (the dot means "this folder").
  3. The Explorer panel on the left now lists your files. Click one to edit it.
Open the project folder, not its parentThe build labs run commands like python -m pytest tests/ that assume you're inside the project folder. If imports fail with ModuleNotFoundError, you almost certainly opened the wrong folder or your terminal is one level up. Open the exact project folder.

3 · The integrated terminal

Everything the labs ask you to "run in your terminal" happens in VS Code's built-in terminal — no separate app needed.

3 · Open the terminal
  1. Open it with Terminal → New Terminal, or the shortcut Ctrl+` (the backtick key, top-left).
  2. It opens already inside your workspace folder — so pwd shows the folder you opened.
  3. Type the lab's commands here and press Enter. Output appears inline.
About that (env-name) at the start of your promptIf your prompt looks like (agents) you@machine project %, the text in parentheses is the active Python environment. It's not an error — it just tells you which environment your python/pip commands will use. You want it to say your project's .venv (next section), not a leftover global one. To leave an environment: run conda deactivate (conda) or deactivate (venv).

4 · Virtual environments — the step people skip

A virtual environment (venv) is a private package folder for one project, so installing something for the Content Assistant doesn't collide with another project. Every build lab starts by creating one. Here's the whole lifecycle.

4 · Create & activate a venv
terminal — macOS / Linuxpython3 -m venv .venv          # create it (once per project)
source .venv/bin/activate       # activate it (each new terminal)
terminal — Windows (PowerShell)py -m venv .venv
.venv\Scripts\Activate.ps1
(.venv) you@machine content-assistant %      # prompt now shows (.venv) — success
▶ How this works

This is the whole life of a virtual environment (venv) — a private package folder for one project so its libraries never clash with another project's. Pick the block for your operating system; the commands do the same two things.

  1. python3 -m venv .venv (Windows: py -m venv .venv) creates the environment in a hidden folder called .venv. You do this once per project — the folder then just sits there.
  2. source .venv/bin/activate (Windows: .venv\Scripts\Activate.ps1) turns it on for the current terminal. You repeat this every time you open a new terminal — activation does not stick.
  3. After activating, python and pip point into .venv, so anything you install lands there and nowhere else.

What the output means: Your prompt gains a (.venv) prefix, e.g. (.venv) you@machine content-assistant %. That prefix is your proof the environment is active — no prefix means you're back on the system Python.

Try this: Run which python (Windows: where python) before and after activating. Before, it points at a system path; after, it points inside .venv. That is exactly what changed.

The #1 cause of "it worked yesterday"The (.venv) only lasts for the terminal window it was activated in. Close the terminal (or open a new one) and you must run the activate line again — otherwise python/pip use the wrong environment and your installed packages "disappear". If a lab command suddenly can't find a package, check your prompt shows (.venv) first.
Point VS Code at the venv tooSo the editor's run button and test panel use the same environment: open the Command Palette (Cmd/Ctrl+Shift+P) → Python: Select Interpreter → choose the one whose path contains .venv. VS Code then auto-activates it in new terminals. If you saw (agents) auto-appear, it's because a different interpreter was selected here — switch it to your project's .venv.

4b · Install the course dependencies

With the venv activated ((.venv) showing in your prompt), install the packages the labs use. The course ships a single requirements file — one command installs everything, so no lesson surprises you with a missing module.

4b · Install everything at once
terminal — inside your activated venvcd path/to/llm-course/code       # where requirements.txt lives
pip install -r requirements.txt   # installs all course + AWS libraries
Successfully installed anthropic boto3 sagemaker langgraph crewai ... 
▶ How this works

With the venv active ((.venv) showing), this installs every library the course uses in one shot, reading the list from a requirements file — so no lesson later fails on a missing module.

  1. cd path/to/llm-course/code moves you into the folder that contains requirements.txt. The cd ("change directory") step matters because the next command looks for that file in the current folder.
  2. pip install -r requirements.txt tells pip to read the file (-r = "from this requirements list") and download every library named in it into your active venv.

What the output means: A stream of downloads ending in Successfully installed anthropic boto3 …. Each name is one library now available to import in your code.

Try this: If you only need a couple of libraries for one chapter, you can skip the big file and run e.g. pip install anthropic on its own — same command, just one package.

That file lives at llm-course/code/requirements.txt and pins the third-party libraries used across the course. What you get, grouped by where it's used:

LibraryUsed in
anthropicClaude & Anthropic chapters (the SDK)
boto3All AWS AI Automation chapters (W1–W14) — the AWS SDK
sagemakerAWS W8–W9 (SageMaker deploy & pipelines)
aws-cdk-lib, constructsAWS W7 & the CDK projects (infrastructure as code)
langchain-core, langchain-anthropic, langgraph, langsmithLangChain & LangGraph chapters
crewai, autogen-agentchatMulti-agent orchestration chapters
dspyPrompt-optimization chapter
mcpMCP server project
numpy, pandas, matplotlib, seaborn, scikit-learnData & app-building, NLP chapters
pydantic, pytestStructured output & testing, used throughout
Install only what a lesson needsThe full file is convenient, but heavy (SageMaker and CrewAI pull in a lot). If you're only doing, say, the Bedrock chapters, pip install boto3 is enough. Each lesson's ▶ Runnable companion folder has its own README naming just the packages that lesson needs.
Install into the venv, not globallyIf your prompt does not show (.venv), pip install puts packages in the wrong place and VS Code won't find them — the classic "boto3 is not recognized" symptom. Activate first (section 4), confirm (.venv), then install.
AWS libraries need AWS credentials to runInstalling boto3 makes the import resolve so you can read and edit the AWS labs. Actually calling AWS (Bedrock, S3, …) additionally needs aws configure credentials and, for Bedrock, model access enabled in your region — see W1 · AWS AI foundations.

5 · Running code and tests

Two ways to run — pick whichever you like; the labs show terminal commands because they're unambiguous.

TaskTerminal (used in the labs)VS Code UI
Run a scriptpython engine.pyOpen the file → click the ▷ Run button (top-right)
Run the testspython -m pytest tests/ -vOpen the Testing panel (flask icon) → Run All
Install a packagepip install pytest
Stop a running programCtrl+C in the terminal
Every lab's offline tests need no API keyAcross the course, the pytest suites are designed to pass with no API key (they use mocks/stubs). So you can run them immediately after pip install pytest — a great way to confirm your environment is healthy before wiring in a real key.

6 · API keys, the safe way

When a lab's optional "go live" step needs the real Claude API, it reads your key from an environment variable — never from code you might commit.

6 · Set your key for the session
terminal — macOS / Linuxexport ANTHROPIC_API_KEY="sk-ant-your-key-here"
terminal — Windows (PowerShell)$env:ANTHROPIC_API_KEY="sk-ant-your-key-here"

Confirm it's set (should print your key):

terminalecho $ANTHROPIC_API_KEY        # Windows: echo $env:ANTHROPIC_API_KEY
▶ How this works

An API key is your private password for the Claude API. You store it in an environment variable — a named value the shell holds in memory — so your code can read it without the key ever being written into a file you might share or commit.

  1. export ANTHROPIC_API_KEY="sk-ant-…" (Windows PowerShell: $env:ANTHROPIC_API_KEY="sk-ant-…") puts your key into that named variable for the current terminal session.
  2. echo $ANTHROPIC_API_KEY (Windows: echo $env:ANTHROPIC_API_KEY) prints the value back so you can confirm it was set. echo just means "print this to the screen".
  3. The Anthropic SDK looks for this exact variable name automatically, so your Python code never has to contain the key itself.

What the output means: The echo line should print your key (starting sk-ant-). If it prints a blank line, the variable isn't set — re-run the export line in this same terminal.

Try this: Open a brand-new terminal and run the echo again — it will be blank, because export only lasts for the terminal you ran it in. That's why the tip below shows how to make it stick.

Never put a key in your code or commit itDon't paste sk-ant-… into a .py file. Use the environment variable above, or a .env file that is listed in .gitignore. The Anthropic SDK reads ANTHROPIC_API_KEY from the environment automatically, so you never reference the key value in code. If a key is ever committed, rotate it immediately in the Anthropic Console.
Make it stick across terminalsThe export above lasts only for that terminal. To set it for every new terminal, add the line to your shell profile (~/.zshrc on modern macOS, ~/.bashrc on Linux) — but only on a machine you control, and never in a file inside a git repo.

7 · Using the Anthropic extension for the course

You've configured the Claude / Anthropic extension — here's how to actually use it as you learn. It's an AI pair-programmer living in the editor: it can read your open files, explain code, generate it, and help debug.

When you're…Ask the extension to…
Reading a lab's code file"Explain this file line by line" — great for the schema/validator and agent-loop code.
Stuck on a failing testPaste the error and ask "why does this test fail and how do I fix it?"
Extending a project"Add a new field to this Pydantic model and update the validator" — then run the tests.
Understanding an errorSelect the traceback → ask "what does this mean?" It maps to the labs' troubleshooting tables.
Learning a concept"Explain what a virtual environment is and why this lab uses one."
7 · A good first prompt
  1. Open any lab's code file (say engine.py).
  2. Open the extension's chat panel (from the Activity Bar icon or the Command Palette).
  3. Ask: "Explain what this file does and how I'd run it, assuming I'm new to Python."
  4. Then try: "I ran the tests and got ModuleNotFoundError — what's wrong?" and compare its answer to the lab's Troubleshooting table.
Learn with it, don't just copy from itThe extension will happily write whole files. For a course, the value is in understanding — ask it to explain why, have it review code you wrote, and always run the tests to verify its suggestions. This is exactly the AI-assisted-development discipline the course covers later (see the Vibe coding and Copilot chapters).
Extension vs. the API you'll build withTwo different things that both use Claude: the extension is a tool that helps you write the course's code in the editor; the Anthropic API/SDK is what the course teaches you to call from your own programs (Chapter 1 onward). You'll use the extension to build the apps, and those apps will call the API themselves.

8 · Your per-lab workflow (memorize this)

Every project lab follows the same rhythm. Once this is muscle memory, the whole course is smooth:

8 · The loop
1. Open the project folder in VS Code        (File -> Open Folder)
2. Open a terminal                           (Ctrl + `)
3. Activate the venv                         source .venv/bin/activate
   -> confirm the prompt shows (.venv)
4. Create files by pasting the lab's blocks  (Explorer -> New File)
5. Run it                                    python .py
6. Run the tests                             python -m pytest tests/ -v
7. (optional) set the key + go live          export ANTHROPIC_API_KEY=...
8. Ask the Anthropic extension when stuck
▶ How this works

This is not code to run — it's the rhythm every lab follows, listed in order. Read it as a checklist you repeat for each project until it's muscle memory.

  1. Steps 1–2 get you set up: open the project folder (not a loose file) and open the integrated terminal.
  2. Step 3 activates the venv — and the crucial confirmation is that your prompt now shows (.venv). If it doesn't, stop and fix that before continuing.
  3. Steps 4–6 are the actual work: create the lab's files, run the script with python <file>.py, then run the tests with python -m pytest tests/ -v.
  4. Steps 7–8 are optional: set your API key to "go live", and ask the Anthropic extension whenever you're stuck.

Try this: The two lines that trip up beginners are steps 3 and 6. If a command "can't find" a package, you almost always skipped step 3 (activation).

9 · Make it automatic — pin the interpreter with a settings file

The steps above work, but you can make VS Code remember the interpreter and testing config for a folder so you don't re-select it each time. VS Code reads a per-folder file at .vscode/settings.json inside your project folder. Create it once.

9 · Create .vscode/settings.json

In your project folder, create a folder named .vscode, and inside it a file settings.json. Replace the interpreter path with your venv's Python (run which python while the venv is active to get it):

<your-project>/.vscode/settings.json

.vscode/settings.json{
  "python.defaultInterpreterPath": "/ABSOLUTE/PATH/TO/.venv/bin/python",
  "python.terminal.activateEnvironment": true,
  "python.testing.pytestEnabled": true,
  "python.testing.pytestArgs": ["."],
  "terminal.integrated.cwd": "${workspaceFolder}",
  "python.analysis.extraPaths": [
    "/ABSOLUTE/PATH/TO/.venv/lib/python3.13/site-packages"
  ]
}
▶ How this works

This is a configuration file, not a program — VS Code reads it automatically for this folder. It's written in JSON: a set of "name": value pairs inside curly braces, separated by commas. It saves you re-selecting the interpreter every time.

  1. "python.defaultInterpreterPath" points VS Code at your venv's Python. Replace the /ABSOLUTE/PATH/TO/.venv/bin/python placeholder with the real path (run which python while the venv is active to get it).
  2. "python.terminal.activateEnvironment": true makes new terminals turn the venv on for you.
  3. "python.testing.pytestEnabled" plus "python.testing.pytestArgs": ["."] wire up the Testing panel to find and run your pytest suite in the current folder.
  4. "python.analysis.extraPaths" tells the code checker where the installed packages live, which clears the red underline under your import lines.

What the output means: No visible output — VS Code silently uses these settings. You'll notice the effect: the correct interpreter is pre-selected and the red squiggles under imports disappear.

Try this: After saving, run Developer: Reload Window from the Command Palette so VS Code re-reads the file. JSON is picky — a missing comma or a stray trailing comma will make it ignore the whole file.

SettingWhat it does
python.defaultInterpreterPathSelects your venv automatically (no "Enter interpreter path" each time)
python.terminal.activateEnvironmentAuto-activates the venv in new terminals
python.testing.pytestEnabled + pytestArgsWires up the Testing panel to run your pytest suite
python.analysis.extraPathsTells Pylance where the packages are, so imports resolve (kills the red underline)
Optional: force the ▷ Run button tooThe Run/Debug button uses VS Code's selected interpreter, which can differ from your terminal. To force it onto your venv, add .vscode/launch.json:
.vscode/launch.json{
  "version": "0.2.0",
  "configurations": [{
    "name": "Python: Current File (my venv)",
    "type": "debugpy", "request": "launch",
    "program": "${file}", "console": "integratedTerminal",
    "python": "/ABSOLUTE/PATH/TO/.venv/bin/python",
    "cwd": "${workspaceFolder}"
  }]
}
After creating either file, run Developer: Reload Window (Cmd/Ctrl+Shift+P) so VS Code re-reads it.
▶ How this works

The green ▷ Run button uses VS Code's selected interpreter, which can differ from the one your terminal activated. This optional file forces the Run/Debug button onto your venv so both agree.

  1. "name" is just the label you'll see in the Run menu — call it anything.
  2. "program": "${file}" means "run whichever file is currently open". ${file} is a VS Code variable it fills in for you.
  3. "python" is the important line: point it at your venv's Python (the same /ABSOLUTE/PATH/TO/.venv/bin/python) so the button never uses a different one.
  4. "cwd": "${workspaceFolder}" runs the file from the folder you opened, so relative paths behave like they do in the terminal.

Try this: Reload the window, then click ▷. If a script that worked in the terminal now also works from the button, this file did its job.

⚠️ The multi-root workspace trap (this bites people hard)If you opened a .code-workspace file (a multi-folder workspace) instead of a single folder, its "settings" block overrides every folder's .vscode/settings.json. Symptom: you set the interpreter per-folder but VS Code keeps auto-selecting some other venv it found in a sibling folder (you'll see its name, e.g. (some-old-env), in the terminal). Fix: put the Python settings in the workspace file itself:
Your.code-workspace{
  "folders": [ /* ... */ ],
  "settings": {
    "python.defaultInterpreterPath": "/ABSOLUTE/PATH/TO/.venv/bin/python",
    "python.terminal.activateEnvironment": false
  }
}
To find out if you're in a workspace: the Explorer title shows "WORKSPACE" and File menu has "Save Workspace As". If you just want one folder, use File → Open Folder instead of opening a .code-workspace.
▶ How this works

A multi-root workspace is a single .code-workspace file that groups several folders. Its own "settings" block beats every folder's .vscode/settings.json — which is why a per-folder interpreter can be silently ignored. The fix is to set Python here instead.

  1. "folders" lists the folders in the workspace — the /* ... */ is just a placeholder comment for whatever's already there; leave it as-is.
  2. The "settings" block is the override. Putting "python.defaultInterpreterPath" here makes it win over any folder-level file.
  3. "python.terminal.activateEnvironment": false is set to false on purpose here — in a workspace you often let the shell hook (section 10) handle activation instead, avoiding a fight between the two.

Try this: Not sure you're even in a workspace? The Explorer title shows "WORKSPACE" and the File menu offers "Save Workspace As". If so, edit this file, not the folder's.

10 · Auto-activate the venv by folder (macOS/Linux, zsh)

Here's the most convenient setup: make the venv activate automatically whenever any terminal enters your project folder — in VS Code and the system Terminal — with nothing to type. This is a shell hook, added once to ~/.zshrc. It's more reliable than VS Code's auto-activation because it targets one specific venv and folder, so a stale environment can never sneak back in.

10 · Add the hook to ~/.zshrc

Open ~/.zshrc (code ~/.zshrc) and paste this at the bottom. Replace the two paths with your project folder and your venv:

~/.zshrc# --- auto-activate the course venv inside my project folder ---
my_course_venv() {
  local proj="/ABSOLUTE/PATH/TO/your-project-folder"
  local venv="/ABSOLUTE/PATH/TO/.venv"
  if [[ "$PWD" == "$proj"* ]]; then
    [[ "$VIRTUAL_ENV" != "$venv" && -f "$venv/bin/activate" ]] && source "$venv/bin/activate"
  elif [[ -n "$VIRTUAL_ENV" && "$VIRTUAL_ENV" == "$venv" ]]; then
    deactivate 2>/dev/null
  fi
}
autoload -Uz add-zsh-hook
add-zsh-hook chpwd my_course_venv   # run on every directory change
my_course_venv                       # and once when the shell starts
# --- end ---
▶ How this works

This is a small shell function you paste once into ~/.zshrc (the file zsh runs at startup). It makes your venv switch on the moment any terminal enters your project folder, and off when you leave — with nothing to type. macOS/Linux only.

  1. my_course_venv() defines the function. The two local lines set proj (your project folder) and venv (your venv) — replace both placeholder paths with your real ones.
  2. The if [[ "$PWD" == "$proj"* ]] test asks "is the current folder ($PWD) inside my project?" The trailing * means subfolders count too. If yes and the venv isn't already on, it runs source …/activate.
  3. The elif branch handles leaving: if you've stepped out of the project but the course venv is still on, it runs deactivate to turn it off.
  4. add-zsh-hook chpwd my_course_venv tells zsh to call the function on every directory change (chpwd), and the bare my_course_venv line runs it once when the shell first opens.

What the output means: Enter the folder → prompt shows (.venv); leave it → the prefix disappears. It behaves the same in VS Code's terminal, Terminal.app, and iTerm, because they all read ~/.zshrc.

Try this: To use it in a terminal you already have open (without restarting), run source ~/.zshrc, then cd into and out of your project and watch the prompt change.

How it behavesEnter the folder (or a subfolder) → venv activates, prompt shows (.venv). Leave it → it deactivates. It works in every zsh terminal on the machine (VS Code, Terminal.app, iTerm) because ~/.zshrc is read by them all. To apply it to your current terminal without reopening: source ~/.zshrc. On Windows, this shell hook doesn't apply — rely on the .vscode/settings.json from §9 instead, or activate manually.
Keep the venv out of cloud-synced foldersIf your code lives in OneDrive / Dropbox / iCloud, do not put the .venv there — thousands of package files will thrash the sync and can corrupt the environment. Keep code in the synced folder and the venv in a local path (e.g. your home directory), and point the settings/hook at that local venv. That's the split this course's author uses.

11 · Verify the whole setup

Create this one-line check in your project folder and run it — it confirms the SDK imports in the environment VS Code is using, and needs no API key.

11 · check_setup.py

<your-project>/check_setup.py

check_setup.pyfrom anthropic import Anthropic
import anthropic, sys
print("anthropic version:", anthropic.__version__)
print("python:", sys.executable)
print("import OK — you can build the labs here.")
terminalpython check_setup.py
anthropic version: 1.x.x
python: /ABSOLUTE/PATH/TO/.venv/bin/python
import OK — you can build the labs here.
▶ How this works

This tiny script is a health check: it proves the Anthropic library is installed in the exact Python that VS Code and your terminal are using. It needs no API key — it only imports and prints, it doesn't call the API.

  1. from anthropic import Anthropic and import anthropic load the library. If the venv is wrong or the install failed, this line errors immediately with ModuleNotFoundError — which is itself a useful signal.
  2. print("anthropic version:", anthropic.__version__) shows which version got installed.
  3. print("python:", sys.executable) prints the full path of the Python actually running the script — this is the line that tells you whether you're in the right venv.
  4. Run it with python check_setup.py from your activated venv.

What the output means: A version number, a python: path that should end in .venv/bin/python, and import OK. If the path is a system Python (like /usr/bin), the wrong interpreter is active — revisit sections 4 and 9.

Try this: Deliberately run it without activating the venv. You'll likely get ModuleNotFoundError or a system python: path — a clear picture of what "wrong environment" looks like.

The one check that tells you everythingIf the printed python: path is your .venv and you see import OK, your environment is correct — any remaining red underline in the editor is just a stale cache, cleared by Developer: Reload Window. If the path is a system Python (e.g. /usr/bin or /opt/homebrew), the wrong interpreter is active — revisit §4 (activate) and §9 (settings).

Troubleshooting — VS Code specifics

⚠️ Common VS Code / environment issues
What you seeWhat it means & the fix
(agents) or another env auto-appears in the terminalVS Code selected that interpreter, or your shell profile activates it. Run Python: Select Interpreter → pick your .venv; or conda deactivate / deactivate.
ModuleNotFoundError right after installingThe venv isn't active (no (.venv) in prompt) or you're in the wrong folder. Activate it and run from the project folder.
The ▷ Run button uses the wrong PythonPython: Select Interpreter and choose the .venv one; reopen the terminal.
command not found: python3Python isn't installed or not on PATH. Install from python.org; on Windows use py.
Terminal opens in the wrong directoryYou opened a parent folder. Open Folder on the exact project folder, or cd into it.
Activate script blocked on WindowsPowerShell execution policy — run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once, then re-activate.
You set the interpreter per-folder but VS Code keeps picking a different venvYou have a .code-workspace open — its settings override folder settings. Put the interpreter in the workspace file's "settings" block (§9 danger note), or open a single folder instead.
A stale env (e.g. (agents)) auto-activates and its python is "command not found"VS Code auto-selected a broken/old venv it found in a parent folder. Set the correct interpreter in the workspace/folder settings and set python.terminal.activateEnvironment appropriately; that env's Python was moved/deleted, so stop pointing at it.
Import works in the terminal but the ▷ Run button failsThe button uses the selected interpreter, not the terminal's venv. Add the launch.json from §9, or select the venv interpreter — then Reload Window.
Two folders with the same name (one has the venv, one doesn't)Confirm which folder VS Code actually has open (Explorer title). Put the code + .vscode config in the folder you truly open, and point it at wherever the .venv really lives.
Red underline persists after fixing the interpreterStale Pylance cache — Developer: Reload Window. Confirm with §11: if check_setup.py prints import OK, the code is fine.

✓ You're ready for the course when…

  • VS Code, the Python extension, and the Anthropic extension are installed.
  • You can open a folder, open the terminal, and see it start in that folder.
  • You can create a venv, activate it, and see (.venv) in your prompt.
  • You can run python file.py and python -m pytest tests/ -v.
  • Your API key is set as an environment variable, never in code.
  • You've asked the Anthropic extension to explain a file.
  • (Optional) A .vscode/settings.json pins the interpreter, and/or a ~/.zshrc hook auto-activates the venv by folder.
  • check_setup.py prints import OK with your .venv path (§11).
NextThat's the whole workspace setup. Head to the course home to pick your path, or jump straight into Chapter 1 · Environment & your first API call, which builds on exactly this setup. Every project uses the per-lab workflow above.
© 2026 studybydoing.in · AI Engineering: Zero to Production · All rights reserved. · About · Privacy Policy · Terms · Contact
Educational content, provided as-is and without warranty. Code samples are examples — review, test, and adapt them before using in production. See the Terms of Use & Disclaimer. Use at your own risk.
© studybydoing.in