MacOS installation guide

Myokit needs a C compiler, Python, and the Sundials ODE solvers to run. Each step of the installation is discussed separately below.

Installing the dependencies

The following components are required to run Myokit:

The compiler

First, if you haven't already, install Xcode and the Xcode Command Line Tools to obtain a compiler (called Clang). These can be obtained at developer.apple.com (you may need to create an account).

Sundials

Next, you need to install Sundials. This can be done easily via homebrew, but a manual install is also possible.

To use homebrew, first follow the instructions on the website to install it. Next, open a terminal and install Sundials by typing

$ brew install sundials

or, in some versions of homebrew,

$ brew install homebrew-science/sundials

Python

Myokit requires Python 3.8 or newer, including the packages NumPy, lxml, Matplotlib and PyQT (either PyQt6, PySide6, PyQt5, or PySide2).

Most of these packages will automatically be installed when you install Myokit (see below), but the PyQt package may require an additional step.

Python is installed on macs by default, but many users prefer to re-install via some alternative route. If you installed Sundials via homebrew, we recommend you use the homebrew version of Python too.

Help I've got multile Python versions!

If you end up with multiple Python versions on your machine, spend some time familiarising yourself with the different ways of loading Python (and its package manager "pip"). In particular, make sure you know which Python version is called when you type python or pip on the command line.

Virtual environments

Myokit has a small set of dependencies, and tries to be compatible with all recent versions of them. So in general it is not necessary to run it from within a virtual environment. If you do want to use virtual environments, some mac users have reported problems mixing conda with brew-installed Sundials, so we recommend using virtualenv instead (which can also be installed using brew).

Installing Myokit

To install Myokit, run

$ pip install myokit

Or use the longer form of the same command:

$ python -m pip install myokit

To also install a GUI component, use either

$ pip install myokit[pyqt]

or

$ pip install myokit[pyside]

Note: If you get a "zsh: no matches found" error at this point, you may need to escape the brackets, e.g.

$ pip install myokit\[pyqt\]

Once installed, try running a simulation using

$ python -m myokit run example

To run Myokit's IDE, type:

$ python -m myokit ide

To upgrade an existing Myokit installation, use

$ pip install --upgrade myokit

Adding OpenCL support

If you want to use the OpenCL based libraries, look here for instructions.

Uninstall

To uninstall Myokit, use

pip uninstall myokit

Python, Sundials, etc. will need to be uninstalled separately.

Licensing

Please note: GCC, Xcode, Sundials, Python etc. are not part of Myokit, and come with their own user licenses.

Further questions

If you have any questions, please email Michael Clerx (michael@myokit.org) or check out the issues page.