To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, 3.10, or 3.11 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.
To install virtualenv type:
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/).
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.