I’m encountering a weird issue when trying to run Napari from a Jupyter notebook. If I run
%gui qt immediately before creating a
Viewer object, napari will complain that I don’t have a Qt event loop set up and thus fail to launch.
Here is a minimal but verifyable example:
When I click the “Restart and run all cells” button, I get the following output from the third cell:
If I instead run the cells one-by-one, adding a pause of approximately 2 seconds between the second and third cells, napari launches correctly and I get this output:
I also tried adding a
time.sleep(10) call in a cell in between the second and third cells, but that did not help (despite the fact that the sleep is several times longer than my manual pause):
This was verified with Napari
0.3.8, and the current latest master branch (
Is this just a limitation of Jupyter/Qt/Napari? Is there something I am doing wrong?