v9.1.1
Menu

Chapter 0: Development Setup (Optional)

Set up the ideal ML development environment: OS, terminal, VS Code, Python, Git, Jupyter, Docker, and AI coding assistants.

Topics
8
Videos
8
Min read
67

Optional Chapter

This chapter is completely optional for this course. You can skip straight to Python Foundations and start learning right away. That said, most professional AI/ML developers use this exact setup — so if you want to build the same environment the industry uses, this is worth your time.

Chapter Overview

Before writing a single line of ML code, you need a properly configured development environment. This chapter walks you through setting up everything from scratch — even if you've never programmed before.

A good setup is invisible: it stays out of your way and lets you focus on learning. A bad setup creates constant friction — packages that won't install, code that runs differently on different machines, and hours lost debugging environment issues instead of building models.

The ML developer's toolkit:

  1. Operating System — Ubuntu or macOS (Unix-based for compatibility)
  2. Terminal — Your command center for everything
  3. VS Code — The editor where you'll spend most of your time
  4. Python — The language of ML, properly isolated with virtual environments
  5. Git & GitHub — Version control for tracking experiments and collaborating
  6. Jupyter Notebooks — Interactive exploration and visualization
  7. Docker — Containerized environments for reproducibility (industry standard)
  8. AI Coding Assistants — Claude Code, Copilot, and Claude extension to accelerate your workflow

Each topic includes installation steps, configuration, and practical tips. By the end of this chapter, you'll have a professional-grade ML development environment ready to go.

Chapter Roadmap

Click any topic to jump in

Explainer video
1
Operating System

Ubuntu, macOS, or Windows with WSL2 — choosing the right OS and installing system packages for ML.

Ubuntu (recommended)macOSWindows + WSL2Why not plain Windows?Cloud alternative (optional)Install essential system packages (Ubuntu/WSL)Set up your shell profileOptional: Configure SSH keys for GitHub
Your workspace

Command line and editor

2
Terminal & CLI

Navigation, file operations, pipes, and process management — the command center for all ML work.

NavigationFile operationsViewing filesSearchingPiping & redirectionCreate the project directory treePopulate files and search through themUse piping, redirection, and process management
3
VS Code

The editor, extensions for Python and Jupyter, keyboard shortcuts — where you'll write all your code.

InstallationEssential extensionsSettingsKeyboard shortcutsRemote development (optional)Install VS Code and essential extensionsConfigure VS Code settings for MLOptional: Connect to a remote GPU server via SSH
Language and version control

Python and Git

4
Python Installation

Python 3.11+, virtual environments, pip — properly isolated Python that won't break your system.

Python 3.10-3.12venv (recommended for beginners)conda/minicondapiprequirements.txtInstall Python and create the virtual environmentInstall ML packages and pin versionsCreate .gitignore and verify the setup
5
Git & GitHub

Version control for tracking experiments, collaborating, and never losing work.

Repository (repo)CommitBranchStage → Commit → PushPull requests (PRs)Initialize a repository and make your first commitsCreate branches for ML experimentsPush to GitHub and collaborate
Advanced tooling

Interactive computing and containers

6
Jupyter Notebooks

Interactive code cells, inline plots, and markdown — the standard for ML exploration and visualization.

Quickest startCellsKernelInline plotsAdvanced: JupyterLabQuickest start: Jupyter in VS CodeAdvanced: Install JupyterLab for a browser-based experienceOptional: Convert notebooks to Python scripts for production
7
Docker

Containers for reproducible environments — run the same code anywhere without dependency conflicts.

ImageContainerDockerfileDocker HubDocker ComposeInstall Docker and verify it worksWrite a Dockerfile for your ML projectBuild the image and run a container
AI-powered development
8
AI Coding Assistants

Claude Code, Copilot, and VS Code extensions — AI tools that accelerate your coding workflow.

Claude VS Code Extension (start here)GitHub Copilot (paid)Claude Code CLI (advanced, paid)Best practicesLearning with AIInstall Claude extension in VS Code (start here)Optional: Install GitHub Copilot for inline suggestionsAdvanced: Install Claude Code CLI for terminal-based AI

Topics

8 topics in this chapter

You follow a tutorial for training an image model, and the very first command fails because your machine does not have the tool it calls. Or a package that installs in seconds for everyone else spends twenty minutes trying to compile and then errors out. Most of these problems are not about Python or machine learning at all. They come from the operating system underneath, because the ML ecosystem is built and tested almost entirely on Unix-like systems.

This is the first topic of the Foundations plan, so it assumes nothing beyond a computer you can install software on. Everything later, from the terminal to Docker, runs on top of the choice you make here.

We compare the realistic options. Ubuntu Linux is the default of servers and GPU drivers, macOS is Unix underneath with strong Apple Silicon support, and Windows works well through WSL2 but poorly on its own. Cloud notebooks remove local setup entirely. We finish with three setup steps: installing system packages, configuring a shell profile, and creating SSH keys for GitHub.

Definition

An operating system manages a computer's hardware and runs every other program on top of it. Linux and macOS are Unix-like: they share forward-slash paths, a POSIX shell, and the same core command-line tools. WSL2 runs a real Linux kernel inside a lightweight virtual machine on Windows, giving Windows users the same Linux environment that ML servers and containers use.

In this topic

  1. 1Ubuntu (recommended)
  2. 2macOS
  3. 3Windows + WSL2
  4. 4Why not plain Windows?
  5. 5Cloud alternative (optional)
  6. 6Install essential system packages (Ubuntu/WSL)
  7. 7Set up your shell profile
  8. 8Optional: Configure SSH keys for GitHub
1 of 8
Ubuntu (recommended)

Ubuntu is the most widely used OS in ML development. Nearly all cloud instances, Docker containers, and CI/CD pipelines run Ubuntu, so learning it means your local setup matches production. NVIDIA's CUDA toolkit and GPU drivers receive first-class support on Ubuntu, with the latest versions always available through official repos. If you're starting fresh, Ubuntu 22.04 LTS is the safest choice — it has the widest package compatibility and 5 years of security updates.

# Check your Ubuntu version
lsb_release -a

# Check kernel version
uname -r

# Check system architecture
arch
Run these commands in your terminal
Expected output:
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
6.5.0-44-generic
x86_64
2 of 8
macOS

macOS is Unix-based, which means nearly all Linux terminal commands work out of the box — no compatibility layers needed. Apple Silicon chips (M1/M2/M3/M4) deliver strong ML performance through Apple's Metal framework and the MLX library optimized for on-device training. The developer experience is polished: Homebrew makes installing packages painless, and tools like iTerm2 and Raycast boost productivity. The main limitation is that NVIDIA CUDA is not available on macOS, so if your workflow depends heavily on CUDA-specific libraries, you'll need a Linux machine or cloud GPU for those tasks.

# Check macOS version
sw_vers

# Check if running Apple Silicon or Intel
uname -m
# arm64 = Apple Silicon, x86_64 = Intel

# Install Homebrew (macOS package manager)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Verify Homebrew
brew --version
Run these commands in your terminal
Expected output:
ProductName:    macOS
ProductVersion: 14.4
BuildVersion:   23E214
arm64
Homebrew 4.2.10
3 of 8
Windows + WSL2

WSL2 (Windows Subsystem for Linux) runs a real Linux kernel inside Windows, giving you full Ubuntu access without dual-booting. Run wsl --install in an admin PowerShell and reboot — you'll have a working Ubuntu terminal in minutes. File system performance is best when you keep your project files inside the Linux filesystem (~/projects/) rather than in /mnt/c/. VS Code's Remote-WSL extension connects seamlessly, so you edit in Windows but run code in Linux.

# Run in PowerShell as Administrator:
wsl --install

# After reboot, set Ubuntu as default
wsl --set-default Ubuntu

# Check WSL version
wsl --list --verbose

# Enter WSL from PowerShell
wsl

# Inside WSL, verify you're running Linux
uname -a
Run these commands in your terminal
Expected output:
  NAME      STATE           VERSION
* Ubuntu    Running         2
Linux DESKTOP-ABC123 5.15.153.1-microsoft-standard-WSL2 x86_64 GNU/Linux
4 of 8
Why not plain Windows?

Plain Windows uses backslash path separators (C:\Users\...) while virtually all ML code and documentation assumes forward slashes (/home/user/...). Many Python packages with C extensions fail to compile on Windows because they expect Unix build tools like make and gcc. Shell scripts, Dockerfiles, and CI configurations are written for bash, not PowerShell or CMD. Even when packages do install, subtle differences in file handling, line endings, and environment variables cause hard-to-debug issues that waste hours.

# Demonstrate the path separator difference
# Linux/macOS (forward slashes):
echo $HOME
# /home/user

# Windows CMD (backslashes):
# echo %USERPROFILE%
# C:\Users\user

# Check if common Unix tools exist
which make gcc bash

# On Linux/macOS these exist; on plain Windows they don't
# This is why ML tools break on Windows without WSL
Run these commands in your terminal
Expected output:
/home/user
/usr/bin/make
/usr/bin/gcc
/usr/bin/bash
5 of 8
Cloud alternative (optional)

Google Colab gives you free GPU access (T4) through a Jupyter-like interface in your browser — no local setup required, just a Google account. For more control, AWS EC2 and Lambda Labs offer GPU instances you can SSH into and configure exactly like a local machine. Cloud GPUs are essential if you need to train large models but don't have a local NVIDIA GPU. For this course, a cloud GPU is not necessary — all exercises run fine on CPU — but knowing these options exist helps when you're ready to scale up.

# Check if you have a GPU locally
nvidia-smi 2>/dev/null && echo "GPU available" || echo "No NVIDIA GPU found"

# SSH into a cloud GPU instance (example)
# ssh user@your-cloud-instance

# Check GPU on remote machine
# nvidia-smi

# Google Colab — no install needed:
# 1. Go to colab.research.google.com
# 2. Runtime → Change runtime type → T4 GPU
# 3. Run: !nvidia-smi
Run these commands in your terminal
Expected output:
No NVIDIA GPU found
6 of 8
Install essential system packages (Ubuntu/WSL)

Many Python packages ship parts written in C or C++. When no pre-built wheel matches your system, pip compiles them, and that fails without a compiler. apt update refreshes the package list, and build-essential supplies gcc, g++ and make, the toolchain Ubuntu (recommended) needs for those builds. python3-venv and python3-dev provide virtual environments and the C headers used by extensions. libgl1-mesa-glx and libglib2.0-0 are shared libraries that OpenCV loads at import time. On Ubuntu 24.04 the first is named libgl1 instead, so apt reports it missing. Node.js is needed later for the Claude Code CLI. The version checks at the end confirm each install.

# Update package list and upgrade existing packages
sudo apt update && sudo apt upgrade -y

# Install essential build tools (needed to compile Python packages)
sudo apt install -y build-essential curl wget git

# Install Python prerequisites
sudo apt install -y python3 python3-pip python3-venv python3-dev

# Install libraries needed by OpenCV, Pillow, and other ML packages
sudo apt install -y libssl-dev libffi-dev libgl1-mesa-glx libglib2.0-0

# Install Node.js (needed for Claude Code CLI and Jupyter extensions)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Verify installations
python3 --version
git --version
node --version
Run these commands in your terminal
Expected output:
Python 3.12.3
git version 2.43.0
v20.11.0
7 of 8
Set up your shell profile

Every new terminal reads a startup file, ~/.bashrc for bash on Ubuntu and WSL or ~/.zshrc for zsh on macOS, and runs it before showing the prompt. Anything you put there, such as aliases and environment variables, is available in every session. An alias is a short name for a longer command, so activate expands to the command that enables a project's virtual environment and gs to git status. Edits apply only to new terminals until you run source ~/.bashrc to reload the file. Running the lines with >> twice appends duplicate aliases, and writing to .bashrc while using zsh does nothing, because zsh never reads that file.

# Add useful aliases to your shell profile
# (Use ~/.zshrc on macOS with zsh, ~/.bashrc on Ubuntu/WSL)

echo '' >> ~/.bashrc
echo '# ML Development Aliases' >> ~/.bashrc
echo 'alias py="python3"' >> ~/.bashrc
echo 'alias activate="source .venv/bin/activate"' >> ~/.bashrc
echo 'alias jl="jupyter lab"' >> ~/.bashrc
echo 'alias gs="git status"' >> ~/.bashrc
echo 'alias gc="git commit"' >> ~/.bashrc
echo 'alias gp="git push"' >> ~/.bashrc

# Reload your shell profile
source ~/.bashrc

# Test an alias
gs    # Same as "git status"
Run these commands in your terminal
8 of 8
Optional: Configure SSH keys for GitHub

Pushing to GitHub over HTTPS means authenticating with a personal access token, which gets tedious. SSH keys replace that with public-key cryptography. ssh-keygen -t ed25519 creates a key pair: the private key stays in ~/.ssh/id_ed25519 and must never be shared, while the .pub file is the public half you paste into GitHub's SSH key settings. The agent holds the unlocked key so you type its passphrase once per session. ssh -T [email protected] should greet you by username. A permission error usually means GitHub has the wrong public key, or your repository remote still uses an HTTPS URL instead of the [email protected]: form.

# Generate an SSH key (press Enter for defaults)
ssh-keygen -t ed25519 -C "[email protected]"

# Start the SSH agent
eval "$(ssh-agent -s)"

# Add your key to the agent
ssh-add ~/.ssh/id_ed25519

# Copy the public key to clipboard
cat ~/.ssh/id_ed25519.pub
# Copy the output, then:
# Go to GitHub → Settings → SSH Keys → New SSH Key → Paste

# Test the connection
ssh -T [email protected]
Run these commands in your terminal
Expected output:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.