Installation¶
Prerequisite: LaTeX¶
The visualisation of particular representations of models requires that you have a LaTeX distribution installed.
You can now install MuMoT within a conda environment or within a Python virtualenv.
Installing MuMoT within a Conda environment¶
Install the conda package manager by installing a version of Miniconda appropriate to your operating system.
Open a terminal within which conda is available; you can check this with
conda --version
Create a new conda environment containing just Python >=3.6 e.g.:
conda update conda conda create -n mumot-env python=3.7
Check that conda environment has been created:
conda env list
mumot-env
should appear in the output.Activate the environment:
source activate mumot-env # on macOS/Linux with older versions of conda conda activate mumot-env # on macOS/Linux with newer versions of conda activate mumot-env # on Windows
Install MuMoT and dependencies into this conda environment:
conda install graphviz python -m pip install path/to/clone/of/MuMoT/repository
NB if your clone of the MuMot repository is a subdirectory of the current directory, make sure you run
python3 -m pip install ./MuMoT
instead ofpython3 -m pip install MuMoT
(to ensure MuMoT is installed from your Git clone and not from PyPI).
Installing MuMoT within a VirtualEnv¶
Ensure you have the following installed:
- Python >= 3.6
- the pip package manager (usually comes with Python 3.x but might not for certain flavours of Linux)
- the virtualenv tool for managing Python virtual environments
- graphviz
You can check this by opening a terminal and running:
python3 --version python3 -m pip --version python3 -m virtualenv --version dot -V
Create a Python virtualenv in your home directory:
cd python3 -m virtualenv mumot-env
Activate this Python virtualenv:
source mumot-env/bin/activate # on macOS/Linux mumot-env/bin/activate # on Windows
Install MuMoT and dependencies into this Python virtualenv, then enable interactive Notebook widgets:
python3 -m pip install path/to/clone/of/MuMoT/repository jupyter nbextension enable --py widgetsnbextension --sys-prefix
NB if your clone of the MuMot repository is a subdirectory of the current directory, make sure you run
python3 -m pip install ./MuMoT
instead ofpython3 -m pip install MuMoT
(to ensure MuMoT is installed from your Git clone and not from PyPI).
Installing MuMoT from PyPI¶
Follow the instructions as above for ‘Installing MuMoT within a VirtualEnv’, but at stage 5 replace
python3 -m pip install path/to/clone/of/MuMoT/repository
with
python3 -m pip install mumot
(Optional) Enable tables of contents for individual Notebooks¶
Hyperlinked tables of contents can be userful when viewing longer Notebooks such as the MuMoT User Manual.
Tables of contents can be displayed if you enable the TOC2 Jupyter Extension as follows:
Ensure the
jupyter_contrib_nbextensions
package is installed. This is “a collection of extensions that add functionality to the Jupyter notebook”. If you installed MuMoT into a virtualenv using pip then you need to ensure that virtualenv is activated before running:pip install jupyter_contrib_nbextensions
Enable
jupyter_contrib_nbextensions
:jupyter contrib nbextension install --sys-prefix
Enable the TOC2 (‘table of contents’) extension that is provided by
jupyter_contrib_nbextensions
:jupyter nbextension enable toc2/main
Enable a graphical interface for enabling/disabling TOC2 and other Jupyter extensions. If using conda:
conda install -c conda-forge jupyter_nbextensions_configurator
Or if using a virtualenv instead:
pip install jupyter_nbextensions_configurator # AND jupyter nbextensions_configurator enable --sys-prefix
The next time you start Jupyter from your conda environment or virtualenv then open a Notebook you should see a table of contents displayed down the left-hand-side of the Notebook.
If you subsequently want to disable the TOC2 extension and/or enable other Notebook extensions then click Nbextensions in the Jupyter file browser tab.