Registry / data / mne
library1.12.1pypypi✓ verified 22d ago

MNE-Python is an open-source Python package for exploring, visualizing, and analyzing human neurophysiological data such as MEG, EEG, sEEG, ECoG, NIRS, and more. It provides modules for data input/output, preprocessing, visualization, source estimation, time-frequency analysis, connectivity analysis, machine learning, and statistics. The library is actively developed, with stable releases occurring frequently, typically every few months.

pip install --upgrade mne
INSTALL
IMPORT
SIG · MNE
M
mne
datapythonv1.12.1
Install
13.6s avg
Import
480ms
Disk
352MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.12.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.484s · 348.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 13.6s · import 0.476s · 335MB
352MB installed
● package 352MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mne
import mne
Raw
from mne.io import Raw
Epochs
from mne import Epochs
Evoked
from mne import Evoked
read_raw_fif
from mne.io import read_raw_fif
import mne.read_raw_fif
`read_raw_fif` is in the `mne.io` submodule, not directly under `mne`.
pick_types
from mne.channels import pick_types
import mne.pick_types
`pick_types` is in the `mne.channels` submodule.

This quickstart demonstrates loading a sample MEG/EEG dataset, applying a basic filter to the continuous data, defining events, creating epoched data, computing an evoked response, and finally plotting the evoked activity.

import mne import numpy as np # Set MNE_DATA for sample dataset (optional, will download if not found) os.environ['MNE_DATA'] = os.environ.get('MNE_DATA', mne.utils.get_config('MNE_DATA', default='')) # Load a sample dataset data_path = mne.datasets.sample.data_path() raw_fname = data_path / 'MEG' / 'sample' / 'sample_audvis_raw.fif' # Read raw data raw = mne.io.read_raw_fif(raw_fname, preload=True, verbose='error') raw.filter(1, 40, fir_design='firwin') # Set up events and epochs events = mne.find_events(raw, stim_channel='STI 014') event_id = {'aud/left': 1, 'aud/right': 2, 'vis/left': 3, 'vis/right': 4} t_min, t_max = -0.2, 0.5 epochs = mne.Epochs(raw, events, event_id, t_min, t_max, preload=True, verbose='error') # Compute evoked response evoked = epochs['aud/left'].average() # Plot evoked data evoked.plot() print(f"Processed data has {len(epochs)} epochs and {len(raw.ch_names)} channels.")
Debug
Known issues
breakingMNE-Python version 1.9.0 and later requires Python 3.10 or higher. Earlier Python versions are no longer supported.
fix
Upgrade your Python environment to 3.10 or newer.
affects: >=1.9.0
breakingAs of MNE-Python 1.9.0, the `mne.decoding` module explicitly requires `scikit-learn` to be installed.
fix
Ensure `scikit-learn` is installed: `pip install scikit-learn`.
affects: >=1.9.0
gotchaResampling raw data with `mne.io.Raw.resample()` before forming `Epochs` can cause event timing jitter, potentially impacting analyses sensitive to precise event timing.
fix
For final analysis, it is generally recommended to resample `Epochs` objects using `mne.Epochs.resample()` after epoching, or to be aware of the implications if resampling `Raw` data early.
affects: All versions
gotchaUsing mutable default arguments (e.g., lists, dictionaries) in custom functions that interact with MNE-Python objects can lead to unexpected shared state across function calls, a common Python pitfall.
fix
Initialize mutable defaults inside the function, e.g., `def func(arg=None): arg = arg if arg is not None else []`.
affects: All versions
gotchaIncorrectly identifying or handling 'bad' channels can bias results in subsequent processing steps like SSP (Signal Space Projection) or ICA (Independent Component Analysis).
fix
Carefully review channel quality, use `raw.plot(block=True)` for interactive marking, and utilize MNE-Python's tools for marking and interpolating bad channels (e.g., `raw.info['bads']`, `raw.interpolate_bads()`). Consider `autoreject` for automated detection.
affects: All versions
deprecatedThe `subject` parameter in `mne.datasets.eegbci.load_data()` was deprecated in favor of `subjects`.
fix
Use `subjects` instead of `subject` when calling `mne.datasets.eegbci.load_data()`.
affects: >=1.9.0
Upgrade
Version history
1.12.1latest on PyPI · released Apr 20, 2026
Audit
Dependencies
pythonrequiredRuntime environment
numpyrequiredCore numerical operations
scipyrequiredScientific computing tools
matplotlibrequired2D plotting
poochrequiredData fetching and caching
tqdmrequiredProgress bars
jinja2requiredTemplating for reports
decoratorrequiredUtility for decorators
lazy-loaderrequiredLazy loading of modules
packagingrequiredVersion handling
scikit-learnoptionalMachine learning, required for mne.decoding module
pyvistaoptional3D plotting capabilities
freesurferoptionalMRI processing and surface reconstruction (external software)
Agent activity
7 hits · last 30 days
node
6
Resources
mne — pip install mne · libregistry