Workshop Documentation

Physical AI Workshop
Setup Guide

Everything you need to go from a fresh machine to running the workshop hub — usually under 15 minutes.

Written by Jim Seelan

The short version: double-click setup.bat and wait. The script handles everything and opens the browser when it's done. The steps below are just there in case you want to know what's happening.

Before you start

Steps

  1. Get the repository

    Clone it with Git, or download the ZIP from GitHub and unzip it somewhere sensible.

    git clone https://github.com/learnermaker/physical-ai-lab.git
    cd physical-ai-lab
  2. Double-click setup.bat

    No admin rights needed. A terminal window will open and work through the setup automatically. Total time is usually 10–15 minutes on a decent connection.

    Windows SmartScreen If you see a blue "Windows protected your PC" dialog, click More info then Run anyway. This shows up for any script downloaded from the internet.

    Here's what it does:

    StageWhat happens
    [1/9]Looks for Python 3.12 — downloads and installs it quietly if not found
    [2/9]Creates a .venv folder inside the repo (isolated Python environment)
    [3/9]Activates the environment
    [4/9]Installs PyTorch CPU-only (the big one — about 200 MB)
    [5/9]Installs everything else from requirements.txt
    [6/9]Registers the kernel so VS Code notebooks can use this environment
    [7/9]Downloads the MediaPipe hand landmark model (about 8 MB)
    [8/9]Runs a quick check — prints pass/warn/fail for each package
    [9/9]Opens the hub server and launches the browser
  3. Read the verification output

    Step 8 prints something like this:

    [PASS] numpy
    [PASS] mujoco
    [PASS] gymnasium
    ...
    [WARN] Camera unavailable -- fallback video will be used
    ...
    Setup complete: 13/14 checks passed

    [WARN] is fine — the workshop has built-in fallbacks for webcam and OpenGL. [FAIL] means something needs fixing; the script prints the exact pip install command to run.

  4. Get a Gemini API key optional

    Module 5 can call Google Gemini live to analyse camera frames. You don't need a key — it falls back to pre-recorded responses — but live results are noticeably more interesting.

    Get a free key at aistudio.google.com (sign in → Get API key), then:

    # In the repo folder — Windows
    copy .env.example .env
    # Open .env in Notepad and add your key:
    # GEMINI_API_KEY=AIzaSy...your_key
  5. Watch the HalfCheetah agent optional

    Before the workshop, run this to see what a trained RL agent actually looks like. It's a good warm-up for Module 3, and people tend to find it surprisingly impressive.

    python modules/02_simulation/03_pretrained_agent.py

    A MuJoCo window opens with a cheetah robot running. No GPU required.

Safe to re-run If something fails partway through, just run setup.bat again. It detects what's already done and skips those steps.

If you'd rather do it yourself — or if setup.bat is giving you grief — here are the individual steps. You'll need Python 3.12 installed first.

What you need

1. Clone the repo

git clone <repo-url>
cd physical-ai-workshop

2. Create and activate a virtual environment

This keeps the workshop packages separate from everything else on your machine.

# Create
py -3.12 -m venv .venv

# Activate (Windows)
.venv\Scripts\activate

# Your prompt should now show (.venv)
Keep this terminal open All the commands below need to run in the activated environment. If you close the terminal and come back, run .venv\Scripts\activate again before continuing.

3. Upgrade pip

python -m pip install --upgrade pip

4. Install PyTorch (CPU build)

This needs to go in before the rest so that packages like Stable-Baselines3 link against the right version. It's about 200 MB so give it a minute.

pip install torch==2.14.0+cpu --index-url https://download.pytorch.org/whl/cpu

# Quick check:
python -c "import torch; print(torch.__version__)"
# Should print: 2.14.0+cpu

5. Install workshop packages

pip install -r requirements.txt

# Installs: numpy, mujoco, gymnasium, stable-baselines3,
# opencv-python, mediapipe, google-genai, fastapi, and more.
# Around 500 MB. Takes 3–10 minutes.

6. Register the Jupyter kernel

python -m ipykernel install --user --name physical-ai --display-name "Physical AI Workshop"

7. Hand landmark model

This should already be in assets/ if you cloned the repo. If it's missing:

python -c "
import urllib.request, pathlib
pathlib.Path('assets').mkdir(exist_ok=True)
urllib.request.urlretrieve(
    'https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/latest/hand_landmarker.task',
    'assets/hand_landmarker.task'
)
print('done')
"

8. Verify

python verify_install.py

All 14 checks should be [PASS] or [WARN]. A warning just means a fallback is active — the workshop still works.

9. Add your Gemini key optional

copy .env.example .env
# Edit .env and set:
# GEMINI_API_KEY=AIzaSy...your_key
# Get a free key at https://aistudio.google.com/

10. Start the hub

python api/server.py

Open http://localhost:8000 in Chrome or Edge.

Next time you sit down You only do the pip installs once. For any future session just:
.venv\Scripts\activate
python api/server.py

If you've been through the setup already, you just need two lines to get going:

# Option A — terminal
.venv\Scripts\activate
python api/server.py

# Option B — double-click setup.bat again.
# It'll see the .venv exists and skip straight to launching the server.

Then open http://localhost:8000 in Chrome or Edge and you're in.

What's in the hub

ModuleWhat you actually doServer?
0 — KickoffOverview notebook, pipeline diagram
1 — PerceptionLive hand tracking in the browser — no server neededNo
2 — SimulationReacher-v5 environment streaming live from the serverYes
3 — RLTrain a PPO agent, watch the reward chart update in real timeYes
4 — Perception → ActionMove your hand, watch the Reacher arm followYes
5 — Foundation ModelsCamera frame goes to Gemini, robot action comes backYes
6 — Wrap-upConcept map, sim-to-real, what's next

The exercise files

Every module has an exercise.py. Open it in VS Code next to the browser window. Each one has a # TODO START / END block — usually 3–5 lines of code, completable in 10–15 minutes. The # SOLUTION block at the bottom can be uncommented if you get stuck.

modules/00_kickoff/exercise.py
modules/01_perception/exercise.py
modules/02_simulation/exercise.py
modules/03_rl/exercise.py
modules/04_perception_to_action/exercise.py
modules/05_foundation_models/exercise.py

The notebooks

In VS Code: File → Open Folder → select the repo. Then open a notebook and choose the Physical AI Workshop kernel from the picker in the top-right corner.

modules/00_kickoff/overview.ipynb
modules/03_rl/01_mdp_concepts.ipynb
modules/06_wrapup/concepts_map.ipynb
Heads up The workshop was built and tested on Windows 11. Mac and Linux work for most of it, but if something breaks the Windows instructions are your better reference.

Automated setup

There's a setup.sh that mirrors the Windows script. It needs Python 3.12 already installed:

bash setup.sh

If Python 3.12 isn't on your machine yet:

# Homebrew first, if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install python@3.12
python3.12 --version   # should print 3.12.x
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.12 python3.12-venv python3.12-dev
python3.12 --version

Manual steps

Same as the Manual Setup tab, with two differences:

# Create and activate the venv
python3.12 -m venv .venv
source .venv/bin/activate   # ← not .venv\Scripts\activate

# Everything else is identical
pip install torch==2.14.0+cpu --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
python verify_install.py
python api/server.py

A few things worth knowing

TopicNotes
MuJoCoPip wheels exist for macOS (arm64 + x86_64) and Linux x86-64. Installs without issues.
PyTorch on Apple SiliconThe CPU wheel works fine. For faster Module 3 training you can skip the --index-url flag and get the native MPS build instead — entirely optional.
OpenGL on LinuxIf you're on a headless server, make_env automatically falls back from human rendering to rgb_array to None. Nothing to configure.
MediaPipeWheels exist for macOS arm64/x86_64 and Linux x86_64. Linux aarch64 is not covered.
Webcam on LinuxAdd yourself to the video group if Chrome can't access the camera: sudo usermod -aG video $USER, then log out and back in.
BrowserChrome or Edge required on all platforms. SharedArrayBuffer (needed by MediaPipe WASM) isn't available in Firefox.

Apple Silicon tip

No Rosetta needed PyTorch, MuJoCo, MediaPipe, and OpenCV all ship native arm64 wheels. Just run pip install as normal — pip picks the right one automatically.

Most issues fall into one of these categories. If none of these help, check instructor/COMMON_ISSUES.md in the repo — it has 13 failures documented with exact fix commands.

Setup

The setup.bat window opens and immediately disappears

Right-click setup.batOpen (instead of double-clicking) to keep the window visible. Or run it from a terminal:

cd C:\path\to\physical-ai-workshop
.\setup.bat

Stops at "Locating Python 3.12" without doing anything else

Python 3.12 couldn't be found or downloaded. Check your connection, then install it manually from python.org — tick Add Python to PATH during setup — then re-run setup.bat.

PyTorch takes forever or times out

The CPU wheel is about 200 MB. If pip times out, run it manually in a terminal with the venv active:

.venv\Scripts\activate
pip install torch==2.14.0+cpu --index-url https://download.pytorch.org/whl/cpu

[FAIL] mujoco in the verify output

ARM64 Windows (Surface Pro X, Snapdragon): MuJoCo doesn't have an ARM64 Windows wheel. Run everything inside WSL2:

# PowerShell, as Administrator
wsl --install
# Restart, open Ubuntu, then run: bash setup.sh

Regular x86-64 Windows: Usually a missing C++ runtime. Install it:

winget install Microsoft.VCRedist.2015+.x64

Hub / browser

Hub page is blank or MediaPipe won't load

You need Chrome or Edge. Firefox and Safari don't support SharedArrayBuffer, which MediaPipe's WASM inference requires. Switch browsers and try again.

Port 8000 is already in use

# Find who's using it
netstat -ano | findstr :8000

# Kill it (replace 12345 with the PID in the last column)
taskkill /PID 12345 /F

python api/server.py

VS Code / Jupyter

VS Code is using the wrong Python kernel

Click the kernel name in the top-right of any notebook → Python Environments… → pick Physical AI Workshop. If it's not there, re-register it:

.venv\Scripts\activate
python -m ipykernel install --user --name physical-ai --display-name "Physical AI Workshop"

Module 5 / Gemini

Gemini calls fail or return errors

Check .env exists in the repo root and has a valid key. Module 5 falls back to cached responses automatically if the key is missing — the workshop works either way.

type .env   # should show GEMINI_API_KEY=AIzaSy...