Open psychemedia opened 11 months ago
In the docs, an example is given of using nbconvert as a library:
nbconvert
import nbformat from nbconvert import RSTExporter # Instantiate exporter rst_exporter = RSTExporter() # Read notebook nb = nbformat.read("demo.ipynb", as_version=4) # Create exporter rst_exporter = RSTExporter() # Export notebook to rst (body, resources) = rst_exporter.from_notebook_node(nb) body
This throws an error:
KeyError Traceback (most recent call last) File [~/Library/Python/3.11/lib/python/site-packages/traitlets/traitlets.py:633] in TraitType.get(self, obj, cls) [632] try: --> [633] value = obj._trait_values[self.name] [634] except KeyError: [635] # Check for a dynamic initializer. KeyError: 'template_paths'
Running the CLI command works fine.
Ah.. I wonder if this is a path problem across various python installations, perhaps with env vars pointing to one Jupyter installation but the code actually running against nbconvert in another environment.
In the docs, an example is given of using
nbconvert
as a library:This throws an error:
Running the CLI command works fine.