jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.47k stars 359 forks source link

ipyleaflet 0.19.0 can't be installed with nbextension #1195

Closed ancestor-mithril closed 2 months ago

ancestor-mithril commented 2 months ago

Version 0.18.0 works

pip install ipyleaflet==0.18.0
jupyter nbextension enable --py --sys-prefix ipyleaflet

The last release doesn't work anymore:

pip install ipyleaflet==0.19.0
jupyter nbextension enable --py --sys-prefix ipyleaflet

The error is :

Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-nbextension", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/jupyter_core/application.py", line 283, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.11/site-packages/traitlets/config/application.py", line 1075, in launch_instance
    app.start()
  File "/opt/conda/lib/python3.11/site-packages/notebook/nbextensions.py", line 972, in start
    super().start()
  File "/opt/conda/lib/python3.11/site-packages/jupyter_core/application.py", line 270, in start
    self.subapp.start()
  File "/opt/conda/lib/python3.11/site-packages/notebook/nbextensions.py", line 882, in start
    self.toggle_nbextension_python(self.extra_args[0])
  File "/opt/conda/lib/python3.11/site-packages/notebook/nbextensions.py", line 855, in toggle_nbextension_python
    return toggle(module,
           ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/notebook/nbextensions.py", line 470, in enable_nbextension_python
    return _set_nbextension_state_python(True, module, user, sys_prefix,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/notebook/nbextensions.py", line 368, in _set_nbextension_state_python
    m, nbexts = _get_nbextension_metadata(module)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/notebook/nbextensions.py", line 1109, in _get_nbextension_metadata
    raise KeyError(
KeyError: 'The Python module ipyleaflet is not a valid nbextension, it is missing the `_jupyter_nbextension_paths()` method.'

Environment

Docker container based on nvidia/cuda.

maartenbreddels commented 2 months ago

Hi,

There is not a need anymore for the enable command. Modern notebook (at least v6, maybe even in v5) can auto enabled widgets and other nbextensions. Which means it should work without this command.

Regads,

Maarten