Issues using ipywidgets in Jupyter Notebook with PyCharm

I have a notebook which relies on some ipywidgets to work. In this notebook I also need to pass some magic commands and to open a console connected to the same kernel. The notebook runs fine in Jupyter Notebook web and in Colab without changes, but in PyCharm I have to remove the magic commands and qtConsole in order to run the ipywidgets.

In PyCharm, ANY magic command break the widgets. The widgets do nothing anymore and the Jupyter Terminal shows:

[JupyterQtConsoleApp] ERROR | No such comm target registered: jupyter.widget
[JupyterQtConsoleApp] WARNING | No such comm: af2a245b0db847afb7b2c9cadf5de309

Again, until the insertion of any magic command the widgets work.

The same goes when I open a qtConsole anytime by "jupyter qtconsole --existing b7a23e40-161c-4a8d-9527-38a886bc46dd.json" (PY-31502). The widgets stop working and start to give those error message in console. (I'm not getting the code information from %connect_info, since I already know that magic commands breaks the widgets. Instead I'm picking the code from the terminal inside PyCharm)

What causes this? How can I fix it?

Please sign in to leave a comment.