This guide helps resolve common issues when installing or running HAFiscal.
Run this to check your environment:
./reproduce/test-cross-platform.shThis tests:
- Environment setup
- Python path construction
- LaTeX installation
- Platform compatibility
Problem: UV isn't in your PATH after installation.
Solution:
# Check if UV is installed
ls -la ~/.cargo/bin/uv
# If it exists, add to PATH
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc for macOS
source ~/.bashrc # or source ~/.zshrcProblem: Installation script fails or hangs.
Solution:
# Try manual installation
curl -LsSf https://astral.sh/uv/install.sh > install-uv.sh
bash install-uv.sh
# If that fails, use Conda instead (see INSTALLATION.md)Problem: LaTeX is not installed or not in PATH.
Platform-specific solutions:
macOS:
# If MacTeX is installed, add to PATH
export PATH="/Library/TeX/texbin:$PATH"
echo 'export PATH="/Library/TeX/texbin:$PATH"' >> ~/.zshrc
# If not installed
brew install --cask mactexLinux:
# Install LaTeX
sudo apt-get install texlive-full
# Or minimal install
sudo apt-get install texlive latexmkWindows (WSL2):
# In WSL2 Ubuntu terminal
sudo apt-get install texlive-fullProblem: Error like ! LaTeX Error: File 'subfiles.sty' not found.
Solution:
macOS:
sudo tlmgr install subfiles # or whatever package is missingLinux:
# Install more packages
sudo apt-get install texlive-latex-extra texlive-fonts-recommendedProblem: UV or Conda can't find Python 3.9.
Solution with UV:
# UV will automatically install Python 3.9
uv python install 3.9
uv sync --all-groupsSolution with Conda:
# Specify Python version explicitly
conda env create -f environment.ymlProblem: ModuleNotFoundError: No module named 'HARK' or similar.
Solution:
# Make sure environment is activated (auto-activates in new shells with UV)
# Manual activation if needed:
# source .venv-linux-x86_64/bin/activate # UV (Intel/AMD Linux)
# source .venv-darwin-arm64/bin/activate # UV (Apple Silicon)
# or
conda activate hafiscal # for Conda
# If still failing, reinstall environment
rm -rf .venv-* # Remove all architecture-specific venvs
./reproduce/reproduce_environment_comp_uv.shProblem: LaTeX compilation fails with circular reference errors.
Solution:
This is usually handled automatically by .latexmkrc, but if it persists:
# Clean auxiliary files and rebuild
./reproduce.sh --docs main --cleanProblem: Citation changes don't appear in PDF.
Solution:
# Force full rebuild
cd /path/to/HAFiscal
rm -f *.aux *.bbl *.blg
./reproduce.sh --docs mainProblem: PDF is generated but missing content or has "??" references.
Solution:
# Run full compilation (not --quick)
./reproduce.sh --docs main
# LaTeX needs multiple passes for cross-references
# The script handles this automaticallyProblem: ./reproduce.sh --comp full has been running for days.
Expected behavior: Full computation takes 4-5 days on a high-end 2025 laptop.
Solutions:
-
Run minimal version first:
./reproduce.sh --comp min # ~1 hour -
Monitor progress:
# Check which Python processes are running ps aux | grep python # Monitor CPU usage top # or htop if installed
-
If truly stuck:
# Kill and restart pkill -f python ./reproduce.sh --comp min
Problem: Python script exits with error during computation.
Solution:
-
Check error message - Look for specific module or function that failed
-
Verify environment:
# Activate architecture-specific venv: # source .venv-linux-x86_64/bin/activate (Intel/AMD Linux) # source .venv-darwin-arm64/bin/activate (Apple Silicon) python --version # Should show 3.9.x python -c "import HARK; print(HARK.__version__)"
-
Check memory:
# Linux/macOS free -h # Linux vm_stat # macOS # If low on memory, close other applications
-
Re-run specific script:
cd Code/HA-Models # Activate architecture-specific venv: # source .venv-linux-x86_64/bin/activate # Intel/AMD Linux # source .venv-darwin-arm64/bin/activate # Apple Silicon python do_all.py # or specific script that failed
Problem: Some packages need Rosetta 2 on M1/M2/M3 Macs.
Solution:
# Install Rosetta 2 if prompted
softwareupdate --install-rosetta
# UV handles architecture automaticallyProblem: Compilation errors about missing compilers.
Solution:
xcode-select --installProblem: bash: ./reproduce.sh: Permission denied
Solution:
chmod +x reproduce.sh
chmod +x reproduce/*.shProblem: Python packages fail to install due to missing C libraries.
Solution:
sudo apt-get install build-essential python3-devProblem: Script exits with "❌ ERROR: Broken Symlinks Detected"
Cause: Repository was cloned using Git for Windows and then accessed from WSL2.
Why this happens: Git for Windows converts symlinks to regular text files. When accessed from WSL2, these appear as broken symlinks and the repository won't work.
Solution:
-
Delete the current repository clone (the one cloned from Windows)
-
Open a WSL2 terminal
-
Clone FROM WITHIN WSL2:
cd ~ git clone {{REPO_URL}}.git cd {{REPO_NAME}}
Prevention: Always clone this repository from within WSL2, never from Windows.
Problem: wsl: command not found in PowerShell.
Solution:
- Make sure you're on Windows 10 version 2004+ or Windows 11
- Enable "Virtual Machine Platform" in Windows Features
- Run as Administrator:
wsl --install - Restart computer
Problem: Everything is very slow in WSL2.
Solution:
# Work in WSL filesystem (fast)
cd ~/HAFiscal
# NOT in Windows filesystem (slow)
# Avoid: cd /mnt/c/Users/YourName/HAFiscalWhy? WSL2 accessing Windows filesystem (/mnt/c/...) is much slower than accessing its own filesystem (~/...).
Problem: WSL2 runs out of memory during computation.
Solution:
Create/edit .wslconfig in your Windows user folder (C:\Users\YourName\.wslconfig):
[wsl2]
memory=8GB
processors=4Then restart WSL2:
# In PowerShell
wsl --shutdownProblem: Scripts fail with paths containing spaces.
Solution: Most scripts handle this correctly, but if you encounter issues:
# Move to path without spaces
mv "/path/with spaces/HAFiscal" ~/HAFiscal
cd ~/HAFiscalProblem: Path errors on Linux/WSL2 after editing on Windows.
Expected: All path issues have been fixed (as of 2025-10-22).
If you still see issues:
# Report this as a bug - we thought we fixed all of these!
# Include the error message and file nameProblem: ./reproduce/test-cross-platform.sh shows errors.
Solutions by test:
# .venv not found
./reproduce/reproduce_environment_comp_uv.sh# Usually means Python environment issue
# Activate architecture-specific venv:
# source .venv-linux-x86_64/bin/activate (Intel/AMD Linux)
# source .venv-darwin-arm64/bin/activate (Apple Silicon)
python --version# See "LaTeX Installation Problems" section aboveProblem: ./reproduce/test-ubuntu-22.04.sh fails.
Solution:
-
Check Docker is running:
docker ps
-
Start Docker Desktop (macOS/Windows) or Docker daemon (Linux)
-
Pull Ubuntu image manually:
docker pull ubuntu:22.04
-
Run test again:
./reproduce/test-ubuntu-22.04.sh
Problem: Document generation takes a very long time.
Expected time: 5-10 minutes for --docs main
If slower:
-
Check CPU usage: Should be near 100% during compilation
-
Check disk space: LaTeX needs temporary space
-
Try minimal build:
BUILD_MODE=SHORT ./reproduce.sh --docs main
Problem: Python computations are slower than expected.
Expected time: ~1 hour for minimal, 4-5 days on a high-end 2025 laptop for full
Solutions:
-
Check CPU: Should be near 100% during computation
-
Close other applications: Free up RAM and CPU
-
Check swap usage:
# If heavily swapping, you need more RAM free -h # Linux
Problem: Both Conda and UV are installed, causing confusion.
Solution:
Choose one:
Option A: Use UV (recommended, faster)
# Deactivate conda
conda deactivate
# Use UV
# Activate architecture-specific venv:
# source .venv-linux-x86_64/bin/activate (Intel/AMD Linux)
# source .venv-darwin-arm64/bin/activate (Apple Silicon)Option B: Use Conda
# Deactivate UV env
deactivate
# Use Conda
conda activate hafiscalProblem: Wrong Python version is being used.
Solution:
With UV:
# UV manages Python version automatically
uv sync --all-groups
# Activate architecture-specific venv:
# source .venv-linux-x86_64/bin/activate (Intel/AMD Linux)
# source .venv-darwin-arm64/bin/activate (Apple Silicon)
python --version # Should show 3.9.xWith Conda:
# Conda environment pins Python version
conda activate hafiscal
python --version # Should show 3.9.xProblem: Package downloads fail or timeout.
Solution:
-
Check internet connection
-
Retry with verbose output:
uv sync --all-groups --verbose
-
Try different network:
- Some corporate networks block package repositories
- Try from home network or mobile hotspot
-
Use proxy if needed:
export HTTP_PROXY=http://proxy.example.com:8080 export HTTPS_PROXY=http://proxy.example.com:8080
For better error messages:
# For UV
uv sync --all-groups --verbose
# For reproduction
./reproduce.sh --docs main --verbose
# For shell scripts
bash -x ./reproduce.sh --docs mainLaTeX logs are usually kept:
# Check LaTeX log for detailed errors
less HAFiscal.log
# Check for specific errors
grep "Error" HAFiscal.log
grep "Warning" HAFiscal.logWhen reporting issues, include:
# Platform
uname -a
# Python version
python --version
# UV version
uv --version
# LaTeX version
pdflatex --version
# Environment
echo $PATH
env | grep -i pythonIf none of these solutions work:
-
Search existing issues: {{REPO_URL}}/issues
-
Create new issue with:
- Platform (macOS/Linux/WSL2)
- Error message (full text)
- Steps to reproduce
- System information (see above)
- What you've already tried
- Installation Guide:
INSTALLATION.md - Main README:
README.md - Reproduction Guide:
reproduce/README.md
If you've tried everything in this guide and still have issues:
- Review the Installation Guide - make sure you didn't miss a step
- Check the cross-platform testing documentation
- Search or create an issue on GitHub
- Ask for help in the econ-ark community
Remember: Most issues are environment-related. The most common fix is to start fresh:
# Clean slate
rm -rf .venv-* # Remove all architecture-specific venvs
./reproduce/reproduce_environment_comp_uv.sh
./reproduce.sh --docs mainGood luck! 🎯