The problem is this call to InteractiveShell.instance() in qt integration when called before initializing IPython. If this is called before the inline shell is created, some assumptions are not fulfilled. The fix is ββto first create an inline shell object, then you shouldn't have a problem. And you can get the same object from anywhere in your code simply by calling InteractiveShellEmbed.instance() .
This version should work fine by first creating an InteractiveShellEmbed instance:
from IPython.frontend.terminal.embed import InteractiveShellEmbed
source share