Installation Guide¶
Complete setup instructions for BuildCPG Labs.
System Requirements¶
- Python: 3.11 or higher
- OS: Mac 11+ or Linux (Windows with WSL2)
- Memory: 2GB minimum
- Disk: 1GB for base installation + data
Step 1: Install Prerequisites¶
Install Homebrew (Mac Only)¶
Install Python 3.11+¶
Using Homebrew (Mac):
Using System Package Manager (Linux):
Verify Installation¶
python3 --version
# Should show: Python 3.11.x or higher
pip --version
# Should show: pip 24.0 or higher
Step 2: Clone Repository¶
Using HTTPS¶
Or Using SSH¶
Step 3: Install Global Dependencies¶
These packages are needed at the root level:
Step 4: Verify Setup¶
Check Python¶
Check Git¶
Check Directory Structure¶
Test Config¶
python config/paths.py
# Expected output:
# ✅ Lab1 config loaded: ...
# ✅ Lab1 DB path: /path/to/lab1_sales_performance/data/lab1_sales_performance.duckdb
Step 5: Set Up Lab 1¶
Create Lab Environment¶
cd lab1_sales_performance
python3 -m venv venv
source venv/bin/activate
# If using Mac Zsh and venv doesn't activate:
source venv/bin/activate
Install Lab Dependencies¶
Verify dbt¶
Check dbt Configuration¶
Step 6: Verify Everything Works¶
Test Data Inspector¶
cd /path/to/buildcpg-labs/lab1_sales_performance
python scripts/inspect_data.py
# Should show: Schemas, tables, row counts
Test CSV Monitor¶
Test Config Access¶
Alternative: Automated Setup Script¶
If you want to automate steps 1-5, create this script:
File: setup.sh
#!/bin/bash
set -e
echo "Setting up BuildCPG Labs..."
# Install global dependencies
echo "Installing global dependencies..."
pip install --upgrade pip
pip install pyyaml duckdb pandas mkdocs mkdocs-material
# Setup lab1
echo "Setting up lab1_sales_performance..."
cd lab1_sales_performance
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Verify
echo "Verifying setup..."
cd dbt
dbt debug
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo " cd ../.. (go to root)"
echo " cd lab1_sales_performance"
echo " python scripts/inspect_data.py"
Run it:
Troubleshooting Installation¶
Python version error¶
# If python3 not found
which python3
python3 --version
# Try python (might be Python 2)
python --version
pip command not found¶
venv activation fails on Mac¶
# Try direct path
source ./venv/bin/activate
# Or use Python's venv module directly
python -m venv venv
source venv/bin/activate
dbt debug fails¶
# Make sure you're in the dbt directory
cd lab1_sales_performance/dbt
dbt debug
# If still fails, check dbt installation
pip show dbt-core dbt-duckdb
Permission denied on setup.sh¶
Post-Installation¶
After successful installation:
- Read Quick Start
- Read Architecture Overview
- Try your