Version: 2.0
Last Updated: 2025-11-16
For: {{REPO_NAME}} and econ-ark/HAFiscal
Note: This guide applies to both the source repository ({{REPO_NAME}}) and the public repository (econ-ark/HAFiscal). For contributors editing the source, see CONTRIBUTING.md.
This guide provides detailed, platform-specific instructions for setting up HAFiscal on your system.
HAFiscal is tested and supported on:
- macOS (Intel & Apple Silicon) ✅
- Linux (Ubuntu 22.04 LTS recommended) ✅
- Windows (via WSL2 with Ubuntu 22.04) ✅
- LaTeX Distribution - Required for document generation
- Python 3.9 (exactly) - Required for computational reproduction
- Git - For cloning the repository
- Minimum: 2 GB (LaTeX + Python environment + code)
- Recommended: 5 GB (includes space for computational results)
- Installation: 10-30 minutes (depending on internet speed)
- Document reproduction: 5-10 minutes
- Minimal computation: ~1 hour
- Full computation: 4-5 days on high-end hardware
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Option A: Full MacTeX (Recommended - 4.5 GB)
brew install --cask mactexOption B: BasicTeX (Minimal - 100 MB, may need additional packages)
brew install --cask basictex
brew install latexmkcurl -LsSf https://astral.sh/uv/install.sh | shAdd to your shell profile (UV installer will guide you):
export PATH="$HOME/.cargo/bin:$PATH"Then restart your terminal or run:
source ~/.zshrc # or ~/.bash_profile for bashgit clone {{REPO_URL}}.git
cd {{REPO_NAME}}With UV (Recommended - ~5 seconds):
./reproduce/reproduce_environment_comp_uv.sh
# Or manually:
uv sync
source .venv/bin/activateWith Conda (Alternative - ~2-3 minutes):
conda env create -f environment.yml
conda activate HAFiscal# Test document generation
./reproduce.sh --docs mainSuccess! You should now have HAFiscal.pdf and HAFiscal-Slides.pdf.
LaTeX not found:
# Add MacTeX to PATH
export PATH="/Library/TeX/texbin:$PATH"UV command not found:
# Check UV installation
ls -la ~/.cargo/bin/uv
# If missing, reinstall
curl -LsSf https://astral.sh/uv/install.sh | shPython environment activation fails:
# Make sure you're using UV-created venv
source .venv/bin/activate
# Or use UV's run command
uv run python script.pysudo apt-get updateOption A: Full TeX Live (Recommended - complete distribution)
sudo apt-get install texlive-fullOption B: Medium TeX Live (Faster install, most packages)
sudo apt-get install texlive texlive-latex-extra texlive-fonts-recommended
sudo apt-get install latexmksudo apt-get install build-essential curl gitcurl -LsSf https://astral.sh/uv/install.sh | shAdd to your shell profile:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcgit clone {{REPO_URL}}.git
cd {{REPO_NAME}}With UV (Recommended - ~5 seconds):
./reproduce/reproduce_environment_comp_uv.sh
# Or manually:
uv sync
source .venv/bin/activateWith Conda (Alternative - ~2-3 minutes):
# Install Miniconda first if not present
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
# Then create environment
conda env create -f environment.yml
conda activate HAFiscal./reproduce.sh --docs mainLaTeX packages missing:
# Install additional packages as needed
sudo apt-get install texlive-science texlive-bibtex-extraPermission denied on scripts:
chmod +x reproduce.sh
chmod +x reproduce/reproduce_environment_comp_uv.shImportant: HAFiscal is not supported on native Windows. You must use Windows Subsystem for Linux 2 (WSL2).
Open PowerShell as Administrator and run:
wsl --install
wsl --set-default-version 2Restart your computer.
wsl --install -d Ubuntu-22.04Launch Ubuntu from Start menu and complete initial setup (create username/password).
Once inside WSL2 Ubuntu terminal, follow the Linux Installation steps above.
/mnt/c/
# CORRECT - clone in WSL home directory
cd ~
git clone {{REPO_URL}}.git
# WRONG - do not clone in Windows filesystem
# cd /mnt/c/Users/YourName/ # DON'T DO THISWhy: The repository uses symlinks which don't work properly in /mnt/c/. You'll get git errors and missing figures.
cd ~/HAFiscal
./reproduce.sh --docs main"Operation not supported" on git clone:
- You cloned in
/mnt/c/instead of WSL filesystem - Solution: Clone in
~or/home/yourusername/
Git shows changes to images/ files:
- Symlinks converted to regular files
- Solution:
git config core.symlinks true
git checkout HEAD -- images/LaTeX not found:
# Make sure you're in WSL2, not Windows Command Prompt
wsl --list --verbose # Should show Ubuntu running version 2If you prefer Conda over UV:
macOS/Linux:
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-$(uname)-x86_64.sh
bash Miniconda3-latest-$(uname)-x86_64.shWindows WSL2:
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.shcd HAFiscal
conda env create -f environment.yml
conda activate HAFiscalNote: Conda setup takes ~2-3 minutes vs ~5 seconds for UV. UV is recommended for faster workflows.
After installation, verify everything works:
# Activate environment
source .venv/bin/activate # UV
# or: conda activate HAFiscal # Conda
# Check Python version
python --version # Should be 3.9+
# Check key packages
python -c "import numpy; print(f'numpy: {numpy.__version__}')"
python -c "from HARK import __version__; print(f'econ-ark: {__version__}')"# Check pdflatex
pdflatex --version
# Check bibtex
bibtex --version
# Check latexmk
latexmk --version# Document generation (~5-10 minutes)
./reproduce.sh --docs main
# Verify PDFs created
ls -lh HAFiscal.pdf HAFiscal-Slides.pdf# Minimal computation (~1 hour)
./reproduce.sh --comp min
# This validates the computational environment| Feature | UV | Conda |
|---|---|---|
| Install time | ~5 seconds | ~2-3 minutes |
| Disk space | ~200 MB | ~500 MB |
| Lockfile | uv.lock (fast, deterministic) |
environment.yml |
| Python version control | ✅ Automatic | |
| Cross-platform | ✅ Yes | ✅ Yes |
| Recommendation | ✅ Primary choice | ✅ Fallback option |
When to use Conda:
- Already have Conda installed
- Familiar with Conda workflows
- Need conda-specific packages
When to use UV:
- New installation (faster)
- Want deterministic builds
- Prefer modern Python tooling
UV:
git pull
uv syncConda:
git pull
conda env update -f environment.ymlmacOS:
sudo tlmgr update --self
sudo tlmgr update --allLinux:
sudo apt-get update
sudo apt-get upgrade texlive-fullAfter successful installation:
- Generate Documents:
./reproduce.sh --docs main - Run Minimal Computation:
./reproduce.sh --comp min(~1 hour) - Explore Dashboard:
cd dashboard && voila app.ipynb - Read Documentation: See README.md for detailed usage
- Main README: README.md
- Troubleshooting: TROUBLESHOOTING.md
- Quick Reference: QUICK-REFERENCE.md
- GitHub Issues: {{REPO_URL}}/issues
- Email: ccarroll@jhu.edu (Christopher Carroll)
Last Updated: 2025-11-16
Version: 2.0