4

First I want to point out that every time I pip3, everything goes under this PATH /Users/XXX/Library/Python/3.8/bin, that's the same for Jupyter Notebook. If I which jupyter, it will give me this PATH /Users/XXX/Library/Python/3.8/bin/jupyter

I have Jupyter kernel installed on VS code as well as a stand-alone web based Jupyter Notebook. The issue is that I cannot use nbconvert on both of them. When I say nbconvert, I am talking about cannot convert to HTML. Usually when you installed Jupyter Notebook, the nbconvert to html should work fine. It's usually the nbconvert to pdf does not work well because you need to install some latex tools to be able to run.

Here I will describe what happens when I try to run convert to html on both platform.

Web Based Jupyter Notebook:

enter image description here

VS Code Jupyter Notebook:

Traceback (most recent call last):
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/traitlets/traitlets.py", line 528, in get
    value = obj._trait_values[self.name]
KeyError: 'template_paths'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/XXX/Library/Python/3.8/bin/jupyter-nbconvert", line 8, in <module>
    sys.exit(main())
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/nbconvertapp.py", line 350, in start
    self.convert_notebooks()
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/nbconvertapp.py", line 518, in convert_notebooks
    cls = get_exporter(self.export_format)
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/base.py", line 102, in get_exporter
    if getattr(exporter(config=config), 'enabled', True):
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 325, in __init__
    super().__init__(config=config, **kw)
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/exporter.py", line 114, in __init__
    self._init_preprocessors()
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 491, in _init_preprocessors
    conf = self._get_conf()
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 507, in _get_conf
    for path in map(Path, self.template_paths):
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 518, in _template_paths
    template_names = self.get_template_names()
  File "/Users/XXX/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 601, in get_template_names
    raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'lab' found in the following paths:
    /Users/XXX/Library/Jupyter
    /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter

I also run command like python3 -m jupyter nbconvert --to html notebook.ipynb and it comes to the same error as above.

I think they're caused by the same issue, but I don't really know what's the issue here.

Can someone help me out please? Thank you!

Sheldon
  • 169
  • 1
  • 2
  • 12

0 Answers0