To use PyBaMM, you must have Python 3.8, 3.9, 3.10, 3.11, or 3.12 installed.
To install Python 3 download the installation files from Python’s
website. Make sure to
tick the box on
Add Python 3.X to PATH. For more detailed
instructions please see the official Python on Windows
Launch the Command Prompt and go to the directory where you want to install PyBaMM. You can find a reminder of how to navigate the terminal here.
We recommend to install PyBaMM within a virtual environment, in order not to alter any distribution python files.
python -m pip install virtualenv
To create a virtual environment
env within your current directory
python -m virtualenv env
You can then “activate” the environment using:
Now all the calls to pip described below will install PyBaMM and its
dependencies into the environment
env. When you are ready to exit
the environment and go back to your original system, just type:
PyBaMM can be installed via pip:
pip install pybamm
PyBaMM’s dependencies (such as
scipy, etc) will be
installed automatically when you install PyBaMM using
For an introduction to virtual environments, see (https://realpython.com/python-virtual-environments-a-primer/).
Users can install
jaxlib to use the Jax solver.
The Jax solver is only supported for Python versions 3.9 through 3.12.
pip install "pybamm[jax]"
pip install "pybamm[jax]" command automatically downloads and installs
pybamm and the compatible versions of
jaxlib on your system. (
pybamm_install_jax is deprecated.)
PyBaMM can be uninstalled by running
pip uninstall pybamm
in your virtual environment.
If you want to install the optional PyBaMM solvers, you have to use the Windows Subsystem for Linux (WSL). You can find the installation instructions here.