This guide prepares your computer to run the Python notebooks for the Data
Analysis case studies. The project uses uv to
install Python, create an isolated environment, and install the exact package
versions recorded in uv.lock.
The instructions work on Windows, macOS, and Ubuntu/Debian Linux. For a setup that runs entirely in your browser, use the pre-configured GitHub Codespace.
- uv manages Python and the project environment.
- Visual Studio Code provides the editor and notebook interface.
- Git downloads and updates the repository.
- Graphviz is used by decision-tree diagrams.
- OpenMP is required by XGBoost on macOS.
The project uses Python 3.12.4. You do not need to install Python separately: uv installs the correct version when it creates the environment.
Install the same uv version used by the project and GitHub Actions.
Open PowerShell and run:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/0.11.20/install.ps1 | iex"Open a terminal and run:
curl -LsSf https://astral.sh/uv/0.11.20/install.sh | shClose and reopen the terminal, then verify the installation:
uv --versionSee the official uv installation guide for alternative installation methods.
Download and install Visual Studio Code.
Open the Extensions panel and install:
Install Git, then open a terminal and run:
git clone https://github.com/gabors-data-analysis/da_case_studies.git
cd da_case_studiesAlternatively, copy the repository URL from GitHub:
Then choose Clone Git Repository... on the VS Code start screen:
Open the cloned da_case_studies folder in VS Code. The Explorer should show
the chapter directories:
uv installs Python packages, but it does not install operating-system programs and libraries.
Download and run the current 64-bit installer from the
Graphviz download page. Keep the option that
adds Graphviz to PATH enabled if the installer offers it, then reopen your
terminal.
Install Homebrew if it is not already available, then run:
brew install graphviz libomplibomp supplies the OpenMP runtime required by the macOS XGBoost wheel.
sudo apt-get update
sudo apt-get install graphvizIn a terminal, change to the repository root: the directory containing
pyproject.toml and uv.lock. Then run:
uv sync --frozenuv will:
- Install Python 3.12.4 if needed.
- Create an isolated
.venvdirectory. - Install the exact dependencies from
uv.lock.
Verify the Python environment:
uv run --frozen python -c "import numpy, pandas, xgboost; print('Python environment is ready')"Verify Graphviz:
dot -VYou do not need to activate .venv. Run terminal commands through uv run,
for example:
uv run --frozen python --versionOpen a notebook in VS Code:
- Click Select Kernel in the top-right corner.
- Choose Python Environments.
- Select
da-case-studies (3.12.4). If that label is not shown, select the interpreter inside the repository's.venvdirectory.
The interpreter path ends in .venv/bin/python on macOS and Linux, or
.venv\Scripts\python.exe on Windows. VS Code normally discovers it
automatically after uv sync.
Data is hosted on OSF. You can either:
Unzip or create da_data_repo next to da_case_studies:
parent-folder/
├── da_case_studies/
└── da_data_repo/
You can now run notebook cells in VS Code.
Pull the latest code and restore the locked environment:
git pull
uv sync --frozenProject maintainers should use uv add, uv remove, or uv lock when
dependencies intentionally change, and commit both pyproject.toml and
uv.lock.
- If
uvis not found, close and reopen the terminal after installation. - If VS Code does not show
.venv, runuv sync --frozen, then use Developer: Reload Window from the Command Palette. - If
dotis not found, reinstall Graphviz and ensure itsbindirectory is onPATH. - If XGBoost reports a missing
libomp.dylibon macOS, runbrew install libompand reopen VS Code. - If XGBoost reports a missing DLL on Windows, install Microsoft's Visual C++ Redistributable.





