Installation#

ARGscape has two installation options to fit different use cases:

  • Base installation (pip install argscape): Lightweight package for 2D visualization only. No geospatial dependencies required.

  • Full installation (pip install argscape[spatial]): Includes 3D spatial visualization, web application, and spatial inference tools. Requires geospatial libraries.

Lightweight Installation (pip)#

For 2D visualization only, install the base package:

pip install argscape

This provides:

  • 2D force-directed graph visualization

  • Python API: argscape.visualize(ts) (2D only)

  • CLI: argscape viz (2D only)

import argscape
import tskit

ts = tskit.load("example.trees")
viz = argscape.visualize(ts)  # 2D force graph
viz.show()  # Opens in browser

Optional: Static Export#

For exporting visualizations as PNG, SVG, or PDF, install Playwright:

pip install playwright
playwright install chromium

This enables viz.export("figure.png") and argscape viz -o figure.png.

Verifying Installation#

Test that ARGscape is installed correctly:

import argscape
print(argscape.__version__)

# Check what features are available
print(f"Spatial available: {argscape.is_spatial_available()}")
print(f"Playwright available: {argscape.is_playwright_available()}")

If you have the spatial extras installed, launch the web application:

argscape serve  # Opens browser at http://localhost:8000 - may take a few minutes to load

System Requirements#

  • Python: 3.8 or higher

  • Memory: 3GB+ recommended for large tree sequences

  • Browser: Modern browser (Chrome, Firefox, Safari, Edge) for web interface and visualization export

Troubleshooting#

“Spatial dependencies not installed”#

If you see this error when trying to use 3D visualization or the web app:

Spatial dependencies not installed. Install with: pip install argscape[spatial]

You need the full installation. See the “Full Installation” section above.

Geospatial Library Errors#

If you see errors mentioning GDAL, GEOS, PROJ, or fiona when installing argscape[spatial]:

  1. Use conda (recommended) - This is the most reliable solution

  2. Install system libraries - See the platform-specific instructions above

  3. Use --no-binary fiona - Forces building against system GDAL to avoid version conflicts

Import Errors#

If you encounter import errors after installation:

pip install --upgrade argscape

Playwright Issues#

If visualization export fails with “Playwright is required”, install it:

pip install playwright
playwright install chromium

To reinstall Playwright browsers:

playwright install --force chromium

Next Steps#