- MNE-Python version: 0.24
- operating system: Mac OS 11.3.1
I just updated to .24 and love the new data browser. I have a question about a warning message Iâm receiving along with an error message when using the browser with tkinter.
Following the simple example at GitHub - mne-tools/mne-qt-browser: A new backend for the 2D data browser in MNE-Python, I started with
import mne
mne.viz.set_browser_backend("pyqtgraph")
raw = mne.io.read_raw_edf('myfile.edf',preload=True)
raw.plot(block=True,duration=40,start=10)
The data browser appears and works fine, but I also receive a warning message:
RuntimeWarning: PyOpenGL was not found and OpenGL can't be used! Consider installing pyopengl with "pip install pyopengl".
I then installed pyopengl and ran the code again, only to obtain an extremely long error message ending with the following:
ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)
I then uninstalled pyopengl just so I could at least get things to work.
Question 1: I donât really understand the roles of OpenGL and PyOpenGL and whether I should be concerned about this warning and, if I should be, how I can go about resolving it.
My second question focuses on embedding raw plots on figure tkinter figure canvases. With the previous raw.plot(), I used the following syntax to do this:
import mne
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.backends.backend_tkagg as tkagg
from tkinter import Tk, Frame,TOP,BOTTOM
root = Tk()
root.wm_title("Main Window")
root.geometry('1500x1000')
raw = mne.io.read_raw_edf('myfile.edf',preload=True)
fig=raw.plot(block=True,duration=40,start=10)
canvas_frame=Frame(root,height = 1500,width = 1000)
canvas_frame.pack(side=TOP,expand=True)
canvas = FigureCanvasTkAgg(fig, master=canvas_frame)
canvas.draw()
canvas.get_tk_widget().pack(side=TOP,fill=BOTH,expand=1)
root.mainloop()
This has worked very well for me. However, when I insert mne.viz.set_browser_backend("pyqtgraph")
so as to place the updated browser on the canvas, I receive the same warning as above, along with a lengthy error message ending with
AttributeError: âPyQtGraphBrowserâ object has no attribute âset_canvasâ
Question 2: Is this error related to the above warning and/or is there some other explanation?
I realize mne-qt-browser is a new feature, so please let me know if I should post these questions on its associated github page instead.