Installing MNE-Python

There are many possible ways to install a Python interpreter and MNE. Here we provide guidance for the simplest, most well tested solution.

1. Get a Python interpreter

  • We recommend the Anaconda Python 3+ distribution. Follow their installation instructions. When you are done, you should see some variant of this in a terminal:

    $ conda --version && python --version
    conda 4.4.10
    Python 3.6.4 :: Continuum Analytics, Inc.
    

    If it doesn’t, something went wrong. Look through the Anaconda documentation and Google Anaconda install tips (StackExchange results are often helpful).

2. Get MNE and its dependencies

  • From the command line, install the MNE dependencies to a dedicated mne Anaconda environment.

    $ curl -O https://raw.githubusercontent.com/mne-tools/mne-python/master/environment.yml
    $ conda env create -f environment.yml
    $ source activate mne
    

    Use any web browser to download environment.yml if you do not have curl

  • macOS users only

    Manually update PyQt5. This step is not needed on Linux, and breaks things on Windows.

    $ pip install --upgrade pyqt5>=5.10
    

3. Check that everything works

  • To check that everything worked, do:

    $ python
    

    This should open an Anaconda Python prompt, where you can now do:

    >>> import mne
    

    If you get a new prompt with no error messages, you should be good to go!

  • Windows users only

    In IPython, using the magic %gui qt after importing MNE, Mayavi, or PySurfer might be necessary, e.g.:

    In [1]: from mayavi import mlab
    In [2]: %gui qt