Installation#
PyBaMM is available on GNU/Linux, MacOS and Windows.
It can be installed using pip
or conda
, or from source.
PyBaMM can be installed via pip from PyPI.
pip install pybamm
PyBaMM is available as a conda
package through the conda-forge channel.
The pybamm
package on conda-forge installs PyBaMM with all the required and optional dependencies available on conda-forge.
conda install -c conda-forge pybamm
The ``pybamm-base`` package installs PyBaMM only with its `required dependencies <#install-required-dependencies>`_.
conda install -c conda-forge pybamm-base
Optional solvers#
The following solvers are optionally available:
jax -based solver, see Optional - JaxSolver .
IREE (MLIR) support, see Optional - IREE / MLIR support.
Dependencies#
PyBaMM requires the following dependencies:
Warning
The list of dependencies below might be outdated. Users are advised to manually check the pyproject.toml file to find out supported versions.
Required dependencies#
PyBaMM requires the following dependencies.
Package |
Supported version(s) |
---|---|
0.0.4 |
|
>= 1.23.5, <2 |
|
Whatever recent versions work. >= 1.9.3 |
|
Whatever recent versions work. >= 3.6.7 |
|
Whatever recent versions work. >= 2022.6.0 |
|
Whatever recent versions work. >= 2.8.0 |
|
Whatever recent versions work. >= 1.9.3 |
|
Whatever recent versions work. >= 4.10.0 |
|
Whatever recent versions work. >= 1.5.0 |
|
Whatever recent versions work. >= 1.8.1 |
|
Whatever recent versions work. >= 3.6.5 |
|
Optional Dependencies#
PyBaMM has a number of optional dependencies for different functionalities. If the optional dependency is not installed, PyBaMM will raise an ImportError when the method requiring that dependency is called.
If you are using pip
, optional PyBaMM dependencies can be installed or managed in a file (e.g., setup.py, or pyproject.toml)
as optional extras (e.g.,``pybamm[dev,plot]``). All optional dependencies can be installed with pybamm[all]
,
and specific sets of dependencies are listed in the sections below.
Plot dependencies#
Installable with pip install "pybamm[plot]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
2.3.0 |
plot |
For generating simulation GIFs. |
|
3.6.0 |
plot |
To plot various battery models, and analyzing battery performance. |
Docs dependencies#
Installable with pip install "pybamm[docs]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
- |
docs |
Sphinx makes it easy to create intelligent and beautiful documentation. |
|
- |
docs |
This Sphinx theme provides a great reader experience for documentation. |
|
- |
docs |
A clean, Bootstrap-based Sphinx theme. |
|
- |
docs |
A sphinx extension for designing. |
|
- |
docs |
To copy codeblocks. |
|
- |
docs |
For technical & scientific documentation. |
|
- |
docs |
Add inline tabbed content to your Sphinx documentation. |
|
- |
docs |
For BibTeX citations. |
|
- |
docs |
For re-building docs once triggered. |
|
- |
docs |
To get the “last updated” time for each Sphinx page from Git. |
|
- |
docs |
Sphinx extension that provides a source parser for .ipynb files |
|
- |
docs |
Provides the IPython kernel for Jupyter. |
|
- |
docs |
Interactive HTML widgets for Jupyter notebooks and the IPython kernel. |
|
- |
docs |
Builds an HTML gallery of examples from any set of Python scripts. |
|
- |
docs |
Sphinx extension to show a floating window. |
|
- |
docs |
To replaces Sphinx’s built-in search with Algolia DocSearch. |
Examples dependencies#
Installable with pip install "pybamm[examples]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
- |
examples |
For example notebooks rendering. |
Dev dependencies#
Installable with pip install "pybamm[dev]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
- |
dev |
For managing and maintaining multi-language pre-commit hooks. |
|
- |
dev |
For code formatting. |
|
- |
dev |
For running testing sessions in multiple environments. |
|
- |
dev |
For subtests pytest fixture. |
|
- |
dev |
For calculating test coverage. |
|
6.0.0 |
dev |
For running the test suites. |
|
- |
dev |
For running doctests. |
|
- |
dev |
For running tests in parallel across distributed workers. |
|
- |
dev |
Provides a mocker fixture. |
|
- |
dev |
A |
|
- |
dev |
Used to read metadata from Python packages. |
Cite dependencies#
Installable with pip install "pybamm[cite]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
0.24.0 |
cite |
BibTeX-compatible bibliography processor. |
bpx dependencies#
Installable with pip install "pybamm[bpx]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
- |
bpx |
Battery Parameter eXchange |
tqdm dependencies#
Installable with pip install "pybamm[tqdm]"
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
- |
tqdm |
For logging loops. |
Jax dependencies#
Installable with pip install "pybamm[jax]"
, currently supported on Python 3.9-3.11.
IREE dependencies#
Installable with pip install "pybamm[iree]"
(requires jax
dependencies to be installed).
Dependency |
Minimum Version |
pip extra |
Notes |
---|---|---|---|
20240507.886 |
iree |
IREE compiler |
Full installation guide#
Installing a specific version? Installing from source? Check the advanced installation pages below