Skip to content

Installation

From PyPI

pip install "microsim[all]"

Pin a specific version

microsim changes quickly, and releases can break the API or change simulation results for the same parameters. For any project you want to reproduce later, pin the exact version:

pip install "microsim[all]==0.x.y"

You can check the installed version with microsim.__version__.

The [all] extra installs the plotting, file I/O, and data-download dependencies used throughout these docs. The base package (pip install microsim) can run every simulation, but cannot plot results, write TIFF files, or fetch ground truth from OpenOrganelle.

What each extra installs
Extra Adds Needed for
view matplotlib, ndv ortho_plot, Simulation.plot, interactive viewing
io tifffile, imageio writing .tif output
cosem boto3, s3fs, supabase, imageio CosemLabel ground truth
jax jax the jax backend
torch torch the torch backend
all view, io, cosem, and rich

Latest development version

pip install "microsim[all] @ git+https://github.com/tlambert03/microsim"

The development version changes often.

GPU acceleration

Most of the computation time goes into PSF generation and convolution. These can run on a GPU through CuPy or JAX. Neither is installed by default; follow their installation instructions for your GPU and CUDA version, then select the backend:

sim = ms.Simulation(..., settings=ms.Settings(np_backend="cupy"))

See Settings for details. A torch backend also exists, but is incomplete.

Development install

microsim uses uv for development:

git clone https://github.com/tlambert03/microsim
cd microsim
uv sync
uv run pytest

To build these docs locally:

uv run --group docs zensical serve