File: install_mne_python.rst

package info (click to toggle)
python-mne 0.17%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 95,104 kB
  • sloc: python: 110,639; makefile: 222; sh: 15
file content (101 lines) | stat: -rw-r--r-- 3,321 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.. include:: links.inc

.. _install_python_and_mne_python:

Installing MNE-Python
---------------------

There are many ways to install a Python interpreter and MNE. Here we show a simple well tested solution.

1. Get Python
#############

We recommend the `Anaconda distribution <https://www.anaconda.com/distribution/>`_.
Follow the `installation instructions <http://docs.continuum.io/anaconda/install>`_.
When you are done, you should see a similar output if you type the following command in a terminal:

.. code-block:: console

    $ conda --version && python --version
    conda 4.5.4
    Python 3.6.5 :: Anaconda, Inc.

If you get an error message, consult the Anaconda documentation and search for Anaconda install
tips (`Stack Overflow <https://stackoverflow.com/>`_ results are often helpful).

.. note:: MNE-Python 0.17 will be the last release to support Python 2. From MNE-Python 0.18, only Python 3 will be supported.

2. Get MNE and its dependencies
###############################

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

.. code-block:: console

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

You can also use a web browser to `download the required environment file <https://raw.githubusercontent.com/mne-tools/mne-python/master/environment.yml>`_
if you do not have ``curl``.

.. admonition:: |apple| macOS
  :class: note

  If you are on macOS, you need to manually update PyQt5. This step is not needed on Linux, and even breaks things on Windows.

  .. code-block:: console

    $ pip install --upgrade "pyqt5>=5.10"


3. Check that everything works
##############################

To make sure everything installed correctly, type the following command in a terminal:

.. code-block:: console

    $ python

This should open an interactive Python prompt, where you can type::

    >>> import mne

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

.. admonition:: |windows| Windows
  :class: note

  If you are on Windows, you might have to use the IPython magic command ``%gui qt``
  after importing MNE, Mayavi or PySurfer (see `here <https://github.com/ipython/ipython/issues/10384>`_):

  .. code-block:: ipython

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

The ``$ conda env create ...`` step sometimes emits warnings, but you can ensure
all default dependencies are installed by listing their versions with::

    >>> mne.sys_info()  # doctest:+SKIP
    Platform:      Linux-4.4.0-112-generic-x86_64-with-debian-jessie-sid
    Python:        3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)  [GCC 7.2.0]
    Executable:    /home/travis/miniconda/envs/test/bin/python
    CPU:           x86_64: 48 cores
    Memory:        62.7 GB

    mne:           0.16.2
    numpy:         1.15.0 {blas=mkl_rt, lapack=mkl_rt}
    scipy:         1.1.0
    matplotlib:    2.2.2 {backend=Qt5Agg}

    sklearn:       0.19.1
    nibabel:       2.3.0
    mayavi:        4.6.1 {qt_api=pyqt5, PyQt5=5.10.1}
    cupy:          Not found
    pandas:        0.23.4


For advanced topics like how to get :ref:`CUDA` support or if you are experiencing other issues, check out :ref:`advanced_setup`.