Also when I am trying to run another tutorial example: https://mne.tools/stable/auto_tutorials/clinical/10_ieeg_localize.html
it also give me error message as: AttributeError: ‘_Renderer’ object has no attribute ‘plotter’
I think it might be package version problem. I am using python3.7.11, mayavi-4.7.4, vtk-9.1.0, numpy 1.21.4.
Could you please advise?
Hello @Long, as @BarryLiu97 pointed out, we’d suggest to create an entirely new Python environment for MNE in a situation like this. Please follow the official installation instructions you can find on our website.
Thanks for your help on this. As suggested, I install MNE with conda using:
conda create --name=mne --channel=conda-forge mne
However, when I walk through this example: https://mne.tools/stable/auto_tutorials/clinical/10_ieeg_localize.html, when I am trying to locate the ieeg with command:
There is no plot showed up, and I can see some message in the console as:
qt.qpa.drawing: Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK
qt.qpa.window: <QNSWindow: 0x7f945f391c60; contentView=<QNSView: 0x7f945cdf0460; QCocoaWindow(0x6000029563c0, window=QWidgetWindow(0x600003a33c60, name="QWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
qt.qpa.window: <QNSWindow: 0x7f945f396aa0; contentView=<QNSView: 0x7f945f396690; QCocoaWindow(0x6000029421b0, window=QWidgetWindow(0x600003af1c20, name="QWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
Plot seems stucked through I can see the MNE icon showed up in my mac dock but can’t be clicked to open.
I will try to upgrade to 12.1 and see. And yes, this message doesn’t looks like the error msg, but still the plot get stucked in my dock and wouldn’t come out. Other plots are working just fine.
I think I know where goes wrong.
When I finish plotting the first plot with viewer = T1.orthoview() and close it, error msg will show up as:
Traceback (most recent call last):
File "/Users/long/opt/anaconda3/envs/mne/lib/python3.9/site-packages/matplotlib/cbook/__init__.py", line 287, in process
func(*args, **kwargs)
TypeError: _cleanup() takes 1 positional argument but 2 were given
Then I run mne.gui.locate_ieeg, and it will never show up. However, if I don’t close the first plot, and then go ahead and run the locate_ieeg, this ieeg plot will show up. But since the first plot is always active, I can’t actually bring the second plot forward. So we still need to find a way to close the first plot and working on the second one.
Appreciate any help here.
Ok, so the version of Python is fine; and the previous version of PyQt5 was also fine.
You now have updated outside the limits for MNE: pyqt5>=5.10,<5.14; platform_system == "Darwin".
I have a macOS install on Big Sur, so it’s not 12.xx but I can give it a shot later today and see if I’m able to reproduce.
Never mind, I can reproduce this TypeError: _cleanup() takes 1 positional argument but 2 were given on Windows as well with the current dev version of MNE, but it looks like a bug in nibabel: AttributeError raised in OrthoSlicer3D · Issue #920 · nipy/nibabel · GitHub
Maybe you could try older versions of matplotlib… Or comment this line to skip this problematic plot.
I don’t get the last part however:
But since the first plot is always active, I can’t actually bring the second plot forward. So we still need to find a way to close the first plot and working on the second one.
Each plot opens in a separate free window, for my case I could close the figure and continue… and then when trying to use mne.gui.locate_ieeg I had wrong versions for some dependencies and broke my VTK install
I tried go ahead and call mne.gui.locate_ieeg, however no plot will show up if I do not call the first problematic plot. Very strange. Can you please try on you machine?
For the last part, I mean when I had the problematic plot and locate_ieeg open at the same time, the first problematic plot will always keep active and stay on top of the other plots even after I click on the locate_ieeg plot.
I have tried matplotlib from 3.1 to 3.5. None of them work well for this tutorial example. Actually, the _cleanup() error doesn’t bother me, what I really want is the mne.git.locate_ieeg.