Setup & How to Run

The course code is written in Python 3.12 with JAX, and the environment is managed with uv. The steps below take you from a fresh machine to a running lecture notebook with the exact package versions used in class.

1. Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh
brew install uv
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

2. Get the pinned environment

Download the two environment files and put them in a new folder:

Then, in that folder:

uv sync

uv creates a virtual environment with Python 3.12 and installs the locked versions (JAX, Optax, Optimistix, QuantEcon, Numba, Matplotlib, Jupyter, …) reproducibly.

3. Run a notebook

Download any lecture’s notebook (the Notebook link on a lecture page), drop it in the folder, and launch Jupyter inside the synced environment:

uv run jupyter lab

Or open the folder in VS Code and select the .venv interpreter uv created.

Notes

  • JAX runs on CPU by default. For an NVIDIA GPU, install the CUDA build instead: uv add "jax[cuda12]". Apple Silicon users can stay on the default CPU build (it is fast enough for the course examples).

  • MATLAB kernel (optional). The pinned environment includes matlab-kernel / jupyter-matlab-proxy; these are only needed if a demo uses MATLAB and require a local MATLAB install to actually run. The economics notebooks do not need them.

  • Just the essentials. If you only want to run the JAX economics notebooks without the full lock, this is enough:

    uv venv --python 3.12 && uv pip install jax optax optimistix quantecon numba matplotlib seaborn statsmodels jupyter