Skip to content

not working if jupyter_contrib_nbextensions are installed #2189

Open
@hoba87

Description

I tried to convert a Jupyter notebook to python script with jupyter nbconvert --to python ...

This gave me an error if outdated? jupyter_contrib_nbextension is installed:

Traceback (most recent call last):
  File "/opt/python/python-3.10.10/bin/jupyter-nbconvert", line 5, in <module>
    from nbconvert.nbconvertapp import main
  File "/opt/python/python-3.10.10/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 193, in <module>
    class NbConvertApp(JupyterApp):
  File "/opt/python/python-3.10.10/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 252, in NbConvertApp
    Options include {get_export_names()}.
  File "/opt/python/python-3.10.10/lib/python3.10/site-packages/nbconvert/exporters/base.py", line 145, in get_export_names
    e = get_exporter(exporter_name)(config=config)
  File "/opt/python/python-3.10.10/lib/python3.10/site-packages/nbconvert/exporters/base.py", line 106, in get_exporter
    exporter = items[0].load()
  File "/opt/python/python-3.10.10/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/opt/python/python-3.10.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/python/python-3.10.10/lib/python3.10/site-packages/jupyter_contrib_nbextensions/nbconvert_support/__init__.py", line 5, in <module>
    from .collapsible_headings import ExporterCollapsibleHeadings
  File "/opt/python/python-3.10.10/lib/python3.10/site-packages/jupyter_contrib_nbextensions/nbconvert_support/collapsible_headings.py", line 6, in <module>
    from notebook.services.config import ConfigManager
ModuleNotFoundError: No module named 'notebook.services'

However, when I uninstall it, it works.
So probably, the priority to use it should be downgraded or completely removed.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions