PyMKS is a pure Python package and is fully tested in both Python 2 and 3 and on Windows, Mac OSX and Linux.


Conda is the easiest way to install PyMKS. To install use

$ conda install -c conda-forge pymks

This will install all the requirements necessary to use PyMKS.

$ python -c "import pymks; pymks.test()"

See, for more details on installing and using Conda.



$ pip install pymks

to install from PyPI. Further requirements listed in the requirements file are necessary to use PyMKS when installed using Pip.

Scipy Stack

Both Scipy and Numpy as well as Scikit-learn are required. See the requirements for a full listing of PyMKS dependencies.


To test use,

$ python -c "import pymks; pymks.test()"

to run all the tests with an installed version of PyMKS.


To use the interactive examples from the notebooks/ directory, Jupyter and Matplotlib are both required.


PyMKS can be used without SfePy, but many of the tests and examples require SfePy to generate the sample data so it is a good idea to install it. Sfepy will install automatically with a Conda installation of PyMKS.

To install SfePy manually, use

$ conda -c conda-forge install sfepy


PyMKS can use PyFFTW to compute FFTs instead of Numpy. As long as Numpy is not using Intel MKL, PyFFTW should improve the performance of PyMKS. To use PyFFTW, either set the environment variable

$ export PYMKS_USE_FFTW=1

or set

use-fftw = true

in setup.cfg before installation.

To install PyFFTW use pip

$ pip install pyfftw

or the Conda-Forge Conda channel,

$ conda install -c conda-forge pyfftw

See the PyFFTW installation instructions for more details.

Installation Issues

Please send questions and issues about installation of PyMKS to the list.