Installing TerraFlow via Homebrew¶
Homebrew is the recommended installation method for macOS users. It automatically handles the GDAL and PROJ system-library dependencies that rasterio and pyproj require.
Prerequisites¶
- macOS 12 (Monterey) or later
- Homebrew installed
Install¶
The install step builds a Python 3.12 virtualenv in the Homebrew prefix and symlinks
terraflow into your PATH. Expect a few minutes the first time — GDAL and PROJ may
compile from source.
Verify¶
You should see the usage message listing run, sensitivity, validate, and export.
Update¶
brew update fetches the latest formula from the tap; brew upgrade installs it.
The tap formula is updated automatically on every tagged release via
publish-homebrew.yml.
Uninstall¶
Optional Extras¶
The [h3] and [viz] extras are not available via the Homebrew formula because
Homebrew virtualenvs are isolated. To use H3 export or Plotly visualizations,
install via pip instead:
pip install "terraflow-agro[h3]" # H3 hexagonal export
pip install "terraflow-agro[viz]" # Plotly visualization support
pip install "terraflow-agro[h3,viz]" # both
Troubleshooting¶
GDAL environment variable conflicts¶
If you see CPLE_AppDefined errors or rasterio emits NotGeoreferencedWarning,
a stale environment variable may be overriding the Homebrew-managed GDAL. Unset it:
If the issue persists, reinstall the formula:
PROJ database not found¶
Symptom: pyproj.exceptions.CRSError: PROJ: proj_create_from_database
Fix:
If you have a system PROJ (conda, MacPorts) alongside the Homebrew one, check which takes precedence:
which proj # should resolve to /opt/homebrew/bin/proj (Apple Silicon)
# or /usr/local/bin/proj (Intel)
brew install fails during GDAL build¶
On a fresh machine, the build can fail if Xcode Command Line Tools are incomplete:
Formula not found after brew tap¶
Install the development HEAD¶
Not recommended for production use — this clones the main branch directly.