Install via pip
or conda
#
Hint
If you’re unfamiliar with Python, we recommend using our MNE-Python installers instead.
MNE-Python requires Python version 3.10 or higher. If you need help installing Python, please refer to our Installing Python guide.
Installing MNE-Python with all dependencies#
If you use Anaconda, we suggest installing MNE-Python into its own conda
environment.
First, please ensure you’re using a recent version of conda
. Run in your terminal:
$ conda update --name=base conda # update conda
$ conda --version
The installed conda
version should be 23.10.0
or newer.
Now, you can install MNE-Python:
$ conda create --channel=conda-forge --strict-channel-priority --name=mne mne
This will create a new conda
environment called mne
(you can adjust
this by passing a different name via --name
) and install all
dependencies into it.
If you need to convert structural MRI scans into models of the scalp, inner/outer skull, and cortical surfaces, you will also need to install FreeSurfer.
Installing MNE-Python with core dependencies#
If you only need MNE-Python’s core functionality, which includes 2D plotting
(but does not support 3D visualization), install via pip
:
$ pip install mne
or via conda
:
$ conda create --channel=conda-forge --strict-channel-priority --name=mne mne-base
This will create a new conda
environment called mne
(you can adjust
this by passing a different name via --name
).
This minimal installation requires only a few dependencies. If you need additional functionality later on, you can install individual packages as needed.
Installing MNE-Python with HDF5 support#
If you plan to use MNE-Python’s functions that require
HDF5 I/O (this
includes mne.io.read_raw_eeglab()
, mne.SourceMorph.save()
, and
others), you should run via pip
:
$ pip install "mne[hdf5]"
or via conda
:
$ conda create --override-channels --channel=conda-forge --name=mne mne-base h5io h5py pymatreader
This will create a new conda
environment called mne
(you can adjust
this by passing a different name via --name
).
If you have already installed MNE-Python with core dependencies (e.g. via pip install mne
),
you can install these two packages to unlock HDF5 support:
$ pip install h5io pymatreader
Installing MNE-Python for other scenarios#
The Advanced setup page has additional tips and tricks for special situations (servers, notebooks, CUDA, installing the development version, etc). The Contributing guide has additional installation instructions for (future) contributors to MNE-Python (e.g, extra dependencies for running our tests and building our documentation).