Installation

Larvaworld is published on PyPI and can be installed with pip (recommended) or poetry.

System Requirements

  • Python: 3.10–3.13

  • Operating Systems: Linux, macOS, Windows

  • RAM: Minimum 4 GB (8+ GB recommended for large simulations)

  • Disk Space: ~100 MB for core installation

Basic Installation

Using Poetry

If you’re managing your project with Poetry:

poetry add larvaworld

Poetry is recommended for developers and contributors who need advanced dependency management.

Optional Dependencies

Web dashboards (larvaworld-app) are included in the default install. The options below are truly optional and enable specific features:

Installing optional features (PyPI / pip)

If you installed Larvaworld from PyPI using pip install larvaworld, install optional features by installing the relevant third-party packages into the same environment (Larvaworld does not currently expose pip “extras” like larvaworld[nengo]).

# Neural simulators
pip install nengo
pip install brian2

# Physics engine (multisegment body simulation)
pip install box2d-py

Use cases:

  • Neural simulators: required for experiments using NengoBrain or Brian2Brain controllers.

  • Box2D: required for experiments with physics_model=True (multisegment larvae with Box2D).

Note (Linux/WSL/macOS): Installing box2d-py from source may require system build tools and swig. On Ubuntu/Debian:

sudo apt update
sudo apt install -y swig build-essential

Installing optional dependency groups (source / poetry)

If you’re working from source, Larvaworld uses Poetry dependency groups (including optional groups). From the Poetry project root (folder containing pyproject.toml), install any combination of groups:

# Common developer setup (tests + all optional feature groups)
poetry install --with dev,docs,nengo,brian2,box2d

Development Installation

Verifying Installation

Check that Larvaworld is correctly installed:

larvaworld --version

Run a quick test simulation:

larvaworld Exp dish -N 1 -duration 1.0

If this runs without errors, your installation is successful.

Troubleshooting

Issue: larvaworld: command not found

Solution: Ensure your Python environment’s bin/ directory is in your PATH. With Poetry:

poetry shell
larvaworld --version

Issue: ImportError: No module named 'nengo'

Solution: Install the optional dependency:

pip install nengo

Issue: Box2D installation fails on macOS

Solution: Install dependencies via Homebrew first:

brew install swig
pip install box2d-py

Issue: Permission errors during pip install

Solution: Use a virtual environment (recommended) or install for the user only:

pip install --user larvaworld

Issue: BackendUnavailable: Cannot import 'setuptools.build_meta' on Windows

Issue: When installing on Windows, pip may fail to build dependencies from source if setuptools and wheel are not up to date.

Solution: Upgrade pip, setuptools, and wheel before installing:

python -m pip install --upgrade pip setuptools wheel
pip install larvaworld

If the issue persists, try installing build tools explicitly:

pip install --upgrade pip
pip install setuptools wheel
pip install larvaworld

Issue: PyTables on Windows

Issue: PyTables (HDF5 backend) may require pre-built binaries.

Solution: Install from conda-forge if pip fails:

conda install -c conda-forge pytables
pip install larvaworld