# Clarification needed

**URL:** <https://mne.discourse.group/t/clarification-needed/11617>\
**Category:** Support & Discussions\
**Created:** [December 16, 2025, 1:19pm UTC](https://mne.discourse.group/t/clarification-needed/11617 "2025-12-16T13:19:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![1himan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/1himan/32/4697_2.png) [@1himan](https://mne.discourse.group/u/1himan)\
**Post date:** [December 16, 2025, 1:19pm UTC](https://mne.discourse.group/t/clarification-needed/11617/1 "2025-12-16T13:19:24Z")

</div>

MNE 0.1.0.dev18529+g8c0a5a9b4

OS: Windows 11

I was following through this tutorial - [Working with eye tracker data in MNE-Python — MNE 1.11.0 documentation](https://mne.tools/stable/auto_tutorials/preprocessing/90_eyetracking_data.html)

But I got into some problems, and I have doubts related to them. When I just run this part of the tutorial:

```python
import mne
from mne.datasets.eyelink import data_path
from mne.preprocessing.eyetracking import read_eyelink_calibration
from mne.viz.eyetracking import plot_gaze

et_fpath = data_path() / “eeg-et” / “sub-01_task-plr_eyetrack.asc”
eeg_fpath = data_path() / “eeg-et” / “sub-01_task-plr_eeg.mff”

raw_et = mne.io.read_raw_eyelink(et_fpath, create_annotations=[“blinks”])
raw_eeg = mne.io.read_raw_egi(eeg_fpath, events_as_annotations=True).load_data()
raw_eeg.filter(1, 30)

print(raw_et.annotations[0][“ch_names”]) # a blink in the right eye
cals = read_eyelink_calibration(et_fpath)
print(f"number of calibrations: {len(cals)}")
first_cal = cals[0] # let’s access the first (and only in this case) calibration
print(first_cal)
first_cal.plot()
first_cal[“screen_resolution”] = (1920, 1080)
first_cal[“screen_size”] = (0.53, 0.3)
first_cal[“screen_distance”] = 0.9
mne.preprocessing.eyetracking.convert_units(raw_et, calibration=first_cal, to=“radians”)
ps_scalings = dict(pupil=1e3)
raw_et.plot(scalings=ps_scalings)

```

The first plot is appeared as expected and I can see it properly, but as soon as I close it the 2nd plot appears and disappears immediately unless I use block=True. Why is that so?

Also this tutorial assumes we have `pandas` and `defusedxml`installed.

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [December 17, 2025, 2:41pm UTC](https://mne.discourse.group/t/clarification-needed/11617/2 "2025-12-17T14:41:54Z")

</div>

This happens when executing the code in an environment without a QT event loop running in the background, that is to say any other environment than ipython (or the ipython jupyter kernel) with `%matplotlib qt` configured.

To help you further, could you tell us the exact environment you are executing this code in? From the command line? From inside VSCode? A Jupyter Notebook?

---

<div class="post-metadata">

**Author:** ![1himan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/1himan/32/4697_2.png) [@1himan](https://mne.discourse.group/u/1himan)\
**Post date:** [December 18, 2025, 5:58am UTC](https://mne.discourse.group/t/clarification-needed/11617/3 "2025-12-18T05:58:18Z")

</div>

I’m using the nvim code editor(opened in powershell), and running the code via powershell terminal using python command.

`nvim --version` outputs this:  
`NVIM v0.11.5`  
`Build type: Release`  
`LuaJIT 2.1.1741730670`

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/8/87a611b3b92b5b3c5cf5b2a5f092aaec9bafcd4d.jpeg)

You can see in ss attached, that:

First I entered the venv(created using `python -m venv venv` command and installed deps init via `pip install -e .`). Then I ran the app.py file(located in root dir - look at the file explorer on the left side) using python. Then I got this issue.

The case is same even when I run this in vscode with bash.

Another thing that I noticed is, when I run the downloaded python source code(found at the end of that tutorial), the behaviour is a bit different. See here - [https://drive.google.com/file/d/18nV8yGhQd5HWZZEPjFED0N3m\_P1sFZaJ/view?usp=sharing](https://drive.google.com/file/d/18nV8yGhQd5HWZZEPjFED0N3m_P1sFZaJ/view?usp=sharing)

Note: I have not modified anything in the code, just ran the downloaded script as it is.

Even worse, when the `raw_et.plot(scalings=ps_scalings)` is being shown, and I try to open annotations, it gives a infinite recursive error stack in the terminal, untill I interrupt with ctrl+c:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/6/6416513fb004746005da87f11c860ae6061b5f38.jpeg)

---

<div class="post-metadata">

**Author:** ![1himan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/1himan/32/4697_2.png) [@1himan](https://mne.discourse.group/u/1himan)\
**Post date:** [December 18, 2025, 7:21am UTC](https://mne.discourse.group/t/clarification-needed/11617/4 "2025-12-18T07:21:54Z")

</div>

take this minimal snippet for example:

```python
import mne
import matplotlib

mne.viz.set_browser_backend(“qt”)
mne.set_config(“MNE_BROWSER_THEME”, “light”)

Using sample data

=============================================================================

sample_data_folder = mne.datasets.sample.data_path()
raw_file = sample_data_folder / “MEG” / “sample” / “sample_audvis_filt-0-40_raw.fif”
raw = mne.io.read_raw_fif(raw_file)

raw.plot() 

```

even here, the plot dissappears as soon as it appears, giving this message in terminal:  
`Free RAM could not be determined because “psutil” is not installed. Setting precompute`- the code exits immediately.

When I use - raw.plot(block=True), the message still appears but plot is shown.

Well even after installing `psutil` the behaviour remains the same.

Related issues(maybe):

- [Channel traces disappear for raw.plot(scalings='auto') when automatic scaling returns very large values · Issue #383 · mne-tools/mne-qt-browser · GitHub](https://github.com/mne-tools/mne-qt-browser/issues/383)
- [Dissapearing annotations · Issue #13511 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues/13511)

For me originally, It all started with issue #13511 in mne python, I was trying to replicat the bug described in the issue and bumped into this.

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [December 18, 2025, 4:34pm UTC](https://mne.discourse.group/t/clarification-needed/11617/5 "2025-12-18T16:34:11Z")

</div>

Thanks for the detailed description! I’m also a vim user on windows / powershell, so maybe I can help.

First off, if you run your script using the `python` command, MNE-Python is in “batch mode” by default. Meaning that scripts will run top to bottom as fast as possible and then the python process ends (closing all windows). The assumption is that you are executing some analysis pipeline on your data.

For “interactive mode”, you need to have an ipython REPL open. In your case, typing `ipython` in the powershell console would achieve this. Then, from within the REPL, you can first tell ipython that you want a QT event loop running by executing the command `%matplotlib qt` (including the `%`). Next, you can run code by either copy/pasting it into the REPL or by executing `%run <filename>`. Now, figures stay open in the background. Your code does not block and you can keep on executing python code, but as long as you don’t close the REPL, the figure windows will stay open. This is what you’re after I think.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 6, 2026, 5:17am UTC](https://mne.discourse.group/t/clarification-needed/11617/6 "2026-01-06T05:17:28Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
