Embed NengoGUI style model visualization in Jupyter notebooks


I was wondering if there is some way of embedding a nengo_gui style visualization of a nengo model in a jupyter notebook? It would be great for reporting and visualization to be able to do this.

Hi @yedanqi,

There is a way to embed the NengoGUI window into a Jupyter notebook. You can see an example of how do it here. As a note, it can get a little glitchy at times (depends on how you use it, and what browser you are using it in).

1 Like

Hi @xchoo,

I tried the example but it doesn’t seem to work on visual studio code:

but it does work on the browser. Is this to be expected?

@yedanqi, we’ve never tested it in Visual studio before, so we can’t say for certain if it will work. But, looking at the code output, there is a message that may indicate why it is not working:

The nengo_gui.jupyter notebook server extension was not loaded. Please activate it with the following command:
jupyter serverextension enable nengo_gui.jupyter

I presume that if you run that command in the VS terminal, it may end up working?

Oh I already ran that command in the preceding Jupyter cell as shown in the screenshot. It still doesn’t work for Jupyter notebooks in VScode. It’s ok, I will just use the browser version.


1 Like

I think VS Code uses its own front end to Jupyter notebooks which probably does not support standard Jupyter Notebook/Lab extensions (even between Notebook and Lab the set of supported extensions differs). It would probably be necessary to have a separate extension to support VS Code.