To use and/or contribute to PyBaMM, you must have Python 3.6 or 3.7 installed (note that 3.8 is not yet supported).
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 guide.
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 create a virtual environment env
within your current directory type:
python -m venv env
You can then "activate" the environment using:
env\Scripts\activate.bat
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:
deactivate
PyBaMM can be installed via pip:
pip install pybamm
PyBaMM's dependencies (such as numpy
, scipy
, etc) will be installed automatically when you install PyBaMM using pip
.
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.