Install PyBaMM
Set up a virtual environment
We strongly recommend installing PyBaMM inside a virtual environment so that it does not alter your system Python files.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:| Extra | What it adds | Install command |
|---|---|---|
plot | Matplotlib-based plotting via sim.plot() | pip install "pybamm[plot]" |
cite | Citation management via pybamm.print_citations() | pip install "pybamm[cite]" |
bpx | Battery Parameter eXchange format support | pip install "pybamm[bpx]" |
jax | JAX-based solver (see restrictions below) | pip install "pybamm[jax]" |
all | All of the above except JAX | pip install "pybamm[all]" |
Optional — JAX solver
Installjax and jaxlib to use the JAX-based solver:
jax and jaxlib alongside PyBaMM.
The full conda-forge
pybamm package includes jax and jaxlib by default.Docker
ADockerfile is available in the PyBaMM repository for containerised environments.