Skip to content
Advertisement

python async with AsyncKernelManager and Qt not executing

I’m trying to execute code inside a jupyter kernel in a Qt application. I have the below snipplet that is supposed to asynchronously run the code and then print the result

JavaScript

With the above I get the following output

JavaScript

so trying to adjust the code according to an example from qasync to something like

JavaScript

will result in the following exception

JavaScript

I’m pretty at lost at this point, does anyone know how to get this to work?

Advertisement

Answer

You have to create a QEventLoop, also start_kernel must use await. On the other hand it first imports PySide6 and then the other libraries that depend on PySide6 like qasync so that it can deduce the correct Qt binding.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement