Skip to main content
PyBaMM is available on GNU/Linux, macOS, and Windows. It requires Python 3.10–3.14.

Install PyBaMM

All required dependencies (NumPy, SciPy, CasADi, etc.) are installed automatically.

Set up a virtual environment

We strongly recommend installing PyBaMM inside a virtual environment so that it does not alter your system Python files.
1

Create a virtual environment

Run the following command in the directory where you want to work:
2

Activate the environment

3

Install PyBaMM

4

Deactivate when done

For a primer on Python virtual environments, see Real Python — Python Virtual Environments.

Optional dependencies

You can install PyBaMM with optional extras depending on your use case:

Optional — JAX solver

Install jax and jaxlib to use the JAX-based solver:
This automatically installs compatible versions of jax and jaxlib alongside PyBaMM.
The JAX solver requires Python 3.11 or later and is not supported on macOS with an x86_64 (Intel) processor. It works on Linux (x86_64 and ARM), macOS (Apple Silicon), and Windows.
The full conda-forge pybamm package includes jax and jaxlib by default.

Docker

A Dockerfile is available in the PyBaMM repository for containerised environments.

Uninstall