liveBook · Manning

Chapter 5: Setting up VS Code and your Python development environment

What you will learn in chapter 5 of Build Applications with Local AI Models on a Mac

The chapter introduction explains why building an AI application requires moving beyond terminal chats to Python code and a code editor.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduction explains why building an AI application requires moving beyond terminal chats to Python code and a code editor.

Key terms: terminal, Ollama commands, Python code, programmatically, code editor, integrated terminal

5.1 What is VS Code?

This section introduces VS Code as a free code editor that brings writing code, running commands, and adding capabilities into one Mac development workspace.

Key terms: VS Code, code editor, editor pane, integrated terminal, extensions, add-on packages

5.2 Installing VS Code

Introduces the upcoming VS Code installation steps and tells readers who already have VS Code to skip to section 5.3.

5.2.1 Step 1: Install with Homebrew

This subsection explains why VS Code is installed through Homebrew as a cask and what to do if it is already installed.

Key terms: Homebrew, --cask, cask, command-line tools, already installed, verification step

5.2.2 Step 2: Verify the installation

This section shows how to verify a VS Code installation and explains what the terminal shortcut and arm64 label mean.

Key terms: VS Code, code command, Homebrew, arm64, Apple Silicon, translation layer

5.2.3 Step 3: Open VS Code

This section shows how to open VS Code, skip an optional sign-in, and recognize the main parts of its window.

Key terms: Finder, Applications folder, terminal, Continue without signing in, Settings Sync, sidebar, editing area, bottom panel, integrated terminal

5.3 Installing Python 3.13

This section tells readers to install Python 3.13 with Homebrew and verify its version before configuring VS Code for Python.

Key terms: Homebrew, Python 3.13, python3.13 --version, patch number

5.4 Installing the Python extension

This section explains how Microsoft’s Python extension adds coding tools to VS Code.

Key terms: extension, Python extension, syntax highlighting, IntelliSense, error detection, debugger, one-click run

5.4.1 Installation steps

This subsection shows how to install the Microsoft Python extension in VS Code and recognize when it is active.

Key terms: Extensions view, Python extension, Microsoft, Install button, gear icon

5.4.2 What you will see in practice

This section describes the help the Python extension provides while editing a Python file in VS Code and clarifies what a .py file is.

Key terms: colored syntax, keywords, auto-completion, parameters, error underlining, linting warning, Python extension, helpful assistant, .py file, Python source file

5.5 Using the integrated terminal

The section explains how VS Code’s integrated terminal keeps command execution alongside code and output.

Key terms: integrated terminal, VS Code

5.5.1 Opening the terminal

This subsection shows how to open or create a VS Code integrated terminal and explains why it is useful for running code.

Key terms: terminal panel, View > Terminal, Terminal > New Terminal, integrated terminal, macOS shell, Zsh

5.5.2 Verifying your tools

This subsection verifies that Homebrew, Ollama, and Python are accessible from VS Code’s integrated terminal.

Key terms: VS Code’s terminal, Homebrew, Ollama, Python, version

5.6 Creating your project folder

Previews creating a chatbot project folder, opening it in VS Code, and writing, saving, and running a first Python program.

5.6.1 Setting up the workspace

This section shows how to create a dedicated project folder and open it as a VS Code workspace.

Key terms: project folder, my-ai-chatbot, workspace root, sidebar

5.6.2 Creating and running your first file

This section walks through creating, saving, and running a first Python file in VS Code.

Key terms: hello.py, .py extension, integrated terminal, Cmd-S, print(), output

5.6.3 Project structure preview

This subsection previews the project folder’s growth and shows how to find VS Code commands and settings with the command palette.

Key terms: command palette, Cmd-Shift-P

5.7 Exercises

5.8 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 4: Downloading an LLM and having your first conversation Chapter 6: Creating and managing Python virtual environments →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.