[IPKernelApp ERROR: No such comm target registered: jupyter.widget.version

Asked by Mark Shaw

I am running Xubuntu 20.04 (after upgrading from 19.04) as a guest on a VirtualBox VM in a Windows 10 host. After an `apt` install of the `jupyter` metapackage, I keep getting two errors. To reproduce them, I created a Python3 notebook with the following cells:

[1] import ipywidgets as widgets
[2] widgets.__version__
[3] widgets.IntSlider()

On running cell 1 or on re-opening the notebook the following appears in the terminal where I invoked `jupyter notebook`:

[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.version

Cells 1 & 2 run fine. Cell 3 creates the widget and the widget seems to operate fine but the notebook and the jupyter notebook terminal show:

[IPKernelApp] WARNING | Widget Javascript not detected. It may not be installed or enabled properly.

`pip3 list` (showing only relevant elements) results in:

jupyter-client 6.1.2
jupyter-console 6.0.0
jupyter-core 4.6.3
ipykernel 5.2.0
ipython 7.13.0
ipython-genutils 0.2.0
ipywidgets 6.0.0
nbconvert 5.6.1
nbformat 5.0.4
notebook 6.0.3

`jupyter nbextension list` shows:

  config dir: /home/marvin/.jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension enabled
      - Validating: OK

and after I tried: `jupyter nbextension enable --py widgetsnbextension`, the following was added:

  config dir: /etc/jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension enabled
      - Validating: OK

What is the best way of tracking down the problem? Or would I be better off clearing out the local configuration and re-installing via `apt` or `pip3`?

Many thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ipywidgets Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Shaw
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Did you upgrade to 19.10 in between or did you wipe the install off and do a clean install of Focal?

Revision history for this message
Mark Shaw (marvin-littlewood-426716-r) said :
#2

I upgraded from 19.04 to 19.10 and then to 20.04 but the Jupyter I was using was the 19.10 Python 2.7 version, which no longer worked after the upgrade. I therefore installed the Jupyter metapackage and deleted as much configuration in my home directory as I could find.

Revision history for this message
Mark Shaw (marvin-littlewood-426716-r) said :
#3

Don't know if this helps but under xubuntu 19.10, I did the following to get Jupyter Lab and Jupyter Notebook working (culled from my bash history):

sudo apt install nodejs
sudo apt install npm
sudo apt install jupyter-core
pip install jupyterlab
pip install metakernel zmq
python -c 'import backports.shutil_get_terminal_size'
python -c 'import backports.configparser'
pip install configparser==3.5.0b2

With the benefit of hindsight, the most anomalous step seems to be the installation of jupyter-core, which my reading of launchpad indicates would be unnecessary for a python2 system because it is dependant on Python3. Also it was not clear to me why I had to install the updated configparser package but doing so made things work.

After I found that pip was no longer functional in 20.04, so I removed as much of the local pip install stuff as possible from my local configuration folders. (It may be a blessing and a curse that I used pip without sudo!)

Revision history for this message
Mark Shaw (marvin-littlewood-426716-r) said :
#4

Hi!

I was unable to find what was wrong so I employed the following steps were necessary to remove the combination of current and legacy jupyter components:

sudo apt update
sudo apt purge python-ipython-genutils
sudo apt purge jupyter
sudo apt purge npm
sudo apt purge nodejs
sudo apt autoremove
sudo apt purge jupyter-core
sudo apt autoremove
sudo apt upgrade
sudo apt autoremove

This process effectively uninstalls jupyter-core twice, so I am guessing that this component was the cause of previous problems. In the end miniconda provided a better solution for my needs, so I have switched to using that.

Thank you for your help and Keep well!