Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No version of module jupyter-matplotlib is registered #547

Closed
0xfeedbac opened this issue Feb 29, 2024 · 6 comments
Closed

Error: No version of module jupyter-matplotlib is registered #547

0xfeedbac opened this issue Feb 29, 2024 · 6 comments

Comments

@0xfeedbac
Copy link

Describe the issue

After following the installation procedure (pretty much the pip install ipympl) and using the %matplotlib widget magic, an attempt to show a plot produces the following error:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'MPLCanvasModel' from module 'jupyter-matplotlib'
Error: No version of module jupyter-matplotlib is registered
    at f.loadClass (http://100.101.30.95:8000/jupyter/user/ruslan/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.fe2572ece3b7955c89bb.js?v=fe2572ece3b7955c89bb:1:74933)
    at f.loadModelClass (http://100.101.30.95:8000/jupyter/user/ruslan/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:10728)
    at f._make_model (http://100.101.30.95:8000/jupyter/user/ruslan/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:7516)
    at f.new_model (http://100.101.30.95:8000/jupyter/user/ruslan/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:5136)
    at f.handle_comm_open (http://100.101.30.95:8000/jupyter/user/ruslan/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:3893)
    at _handleCommOpen (http://100.101.30.95:8000/jupyter/user/ruslan/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.fe2572ece3b7955c89bb.js?v=fe2572ece3b7955c89bb:1:73470)
    at b._handleCommOpen (http://100.101.30.95:8000/jupyter/user/ruslan/static/lab/jlab_core.7686966ed3d08bd5a5c5.js?v=7686966ed3d08bd5a5c5:1:1331675)
    at async b._handleMessage (http://100.101.30.95:8000/jupyter/user/ruslan/static/lab/jlab_core.7686966ed3d08bd5a5c5.js?v=7686966ed3d08bd5a5c5:1:1333665)

Versions

$ python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.__version__)" && jupyter --version && jupyter labextension list # Jupyter command `jupyter-nbextension` not found.

 3.11.7 (main, Dec 15 2023, 18:12:31) [GCC 11.2.0]
ipympl version: 0.9.3
Selected Jupyter core packages...
IPython          : 8.20.0
ipykernel        : 6.28.0
ipywidgets       : 8.1.2
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.12.5
jupyterlab       : 4.1.2
nbclient         : 0.9.0
nbconvert        : 7.16.1
nbformat         : 5.9.2
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.7.1
JupyterLab v4.1.2
/opt/conda/envs/tfmax/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        jupyter-matplotlib v0.11.3 enabled OK
        @jupyter-widgets/jupyterlab-manager v5.0.10 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /opt/conda/envs/tfmax/share/jupyter/lab
@martinRenou
Copy link
Member

Did you refresh the web page after the installation?

@0xfeedbac
Copy link
Author

0xfeedbac commented Mar 1, 2024

Did you refresh the web page after the installation?

I did, and rebooted the remote server where the jupyter is running to be sure.

@martinRenou
Copy link
Member

Given your information it's difficult to understand what is wrong unfortunately.

You may want to check that you don't have multiple conflicting jupyter installed. Playing around with which jupyter and jupyter --paths commands to check what is your jupyter and where it looks for extensions.

@0xfeedbac
Copy link
Author

0xfeedbac commented Mar 1, 2024

You may want to check that you don't have multiple conflicting jupyter installed. Playing around with which jupyter and jupyter --paths commands to check what is your jupyter and where it looks for extensions.

This has been the problem indeed. There was one installation of Jupyter Hub which appears to be serving the browser window, and one in the current environment (I've tried to uninstall the latter with pip to avoid confusion in the future, but it appears to be needed, as without it cells outputs don't show). Anyway, the problem is now solved, thank you!

Just to have a reference for those who may face similar problem, here is the list of commands that I've run:

  • Since Jupyter Hub has been installed and run as a service, so its paths can be seen from systemctl file
sudo systemctl cat jupyterhub.service 
  • Activate the proper environment and install the extension there
source /opt/jupyterhub/bin/activate
pip install ipympl 
  • Refresh the browser window afterwards

@martinRenou
Copy link
Member

Thanks for reporting back with some more information! Glad you fixed it

@pomergranate
Copy link

I have encountered this problem too after installing the ipympl. However it isn't aroused by the jupyter conflict. Actually what I had done was just to restart the kernel and refresh my browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants