You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on the GUI event loop hooks in IPython, and while working on this issue, I realized that importing backend_inline will trigger matplotlib's "auto backend selection". In many systems, this results in selecting QtAgg and thus in IPython, this effectively calls %gui qt.
The issue is that 'qt' as far as GUI event loop hooks go implies "latest version of Qt", and once a version of Qt is imported in a session, you can't change it. So on a system with e.g. pyside6 and PyQt5 installed, starting IPython with --matplotlib=qt5 will result in an effective %gui qt call, which will import pyside6, followed by a %gui qt5 call, which will refuse to run because it cannot import PyQt5.
I believe that should instead call _get_backend_or_none(), i.e. you want to see if a backend is loaded, you don't want to cause the default to be loaded.
I prevented IPython from importing backend_inline where the problem starts (see here) and it seems to cause no difference in Jupyter notebook - so I'm not entirely sure what matplotlib-inline is supposed to be doing. It's quite likely I don't understand what I'm even testing here.
The text was updated successfully, but these errors were encountered:
I've been working on the GUI event loop hooks in IPython, and while working on this issue, I realized that importing
backend_inline
will triggermatplotlib
's "auto backend selection". In many systems, this results in selectingQtAgg
and thus in IPython, this effectively calls%gui qt
.The issue is that
'qt'
as far as GUI event loop hooks go implies "latest version of Qt", and once a version of Qt is imported in a session, you can't change it. So on a system with e.g.pyside6
andPyQt5
installed, starting IPython with--matplotlib=qt5
will result in an effective%gui qt
call, which will importpyside6
, followed by a%gui qt5
call, which will refuse to run because it cannot importPyQt5
.The culprit is this:
matplotlib-inline/matplotlib_inline/backend_inline.py
Line 213 in fbf0ab8
I believe that should instead call
_get_backend_or_none()
, i.e. you want to see if a backend is loaded, you don't want to cause the default to be loaded.I prevented IPython from importing
backend_inline
where the problem starts (see here) and it seems to cause no difference in Jupyter notebook - so I'm not entirely sure whatmatplotlib-inline
is supposed to be doing. It's quite likely I don't understand what I'm even testing here.The text was updated successfully, but these errors were encountered: