-
-
Notifications
You must be signed in to change notification settings - Fork 396
Closed
Description
Consider this IPython interactive session:
Jupyter QtConsole 4.5.0.dev0
Python 3.6.8 |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0.dev -- An enhanced Interactive Python. Type '?' for help.
In [1]: IP = get_ipython()
In [2]: import os
In [3]: os.environ['QT_API']
Out[3]: 'pyside2'
In [4]: IP.enable_gui('qt')
In [5]: os.environ['QT_API']
Out[5]: 'pyqt5'
In [6]: os.environ['QT_API'] = 'pyside2'
In [7]: os.environ['QT_API']
Out[7]: 'pyqt5'
In [8]: from IPython.lib.guisupport import get_app_qt4
In [9]: app = get_app_qt4()
In [10]: app
Out[10]: <PySide2.QtWidgets.QApplication at 0x7ff9ddd4c568>What happened between 6 and 7?
The answer is that os.environ['QT_API'] gets overwritten in the event-loop all the time once it has been activated. And even though I initially selected pyside2 it changes the env-var to pyqt5. But apparently the desired backend (pyside2) is still used. I do however run into problems, e.g. when importing directly from PyQt5 versus PySide2 depending on the environment variable.
I will attempt a fix.
Metadata
Metadata
Assignees
Labels
No labels