I am running a python azure function which is running a jupyter notebook via the nbconvert
API. This was working for a time, although without deploying new code I have started to get the following error:
No template sub-directory with name 'lab' found in the following paths:
/home/.local/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
The code I am using to achieve this is:
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert import HTMLExporter
...
dl = DictLoader({'footer':
"""
{%- extends 'full.tpl' -%}
{% block input_group %}
{%- if cell.metadata.get('nbconvert', {}).get('show_code', False) -%}
((( super() )))
{%- endif -%}
{% endblock input_group %}
{% block output_group %}
<style> .output_prompt{visibility:hidden;}</style>
{{ super() }}
{% endblock output_group %}
"""})
...
html_exporter = HTMLExporter(extra_loaders=[dl], template_file='footer')
html_exporter.template_name = 'classic'
with open(JUPYTER_DIR + NOTEBOOK_NAME) as f:
nb = nbformat.read(f, as_version=4)
ep = ExecutePreprocessor(timeout=600, kernel_name='python')
ep.preprocess(nb, {'metadata': {'path': JUPYTER_DIR}})
(body, resources) = html_exporter.from_notebook_node(nb)
The functionapp is running the following:
python3.6
nbconvert6.0.3
jupyter-lab0.1.1
I have tried googling the error, the closest thing I have found so far is this which is similar but unanswered and not completely the same. Thought I'd post here to see if anyone knows how to resolve or for me to update if I manage to resolve the issue.
I am quite confused as lab
is not a keyword I am familiar with (outside of maybe jupyterlab
) and isn't being used within the code.
As for the paths mentioned:
home/.local/share/jupyter/
exists and contains nbconvert/templates/html
usr/local/share/jupyter
& usr/share/jupyter
don't existThanks in advance for any help!
In order to add additional paths to be searched, you need to pass TemplateExporter.extra_template_basedirs config options indicating the extra directories to search for templates. Be careful not to override TemplateExporter.template_paths unless you intend to replace ALL paths and don’t want the default locations included.
No certificate templates could be found. You do not have permission to request a certificate from this CA, or an error occurred while accessing the Active Directory. Certificate enrollment does work through the Certificates MMC, in fact I was able to create a certificate to secure the CA’s Default Web Site.
If you have feedback for TechNet Support, contact [email protected]. Sorry for taking a vacation but this sort of got sidetracked until now that the customer needs to make certificates. "No certificate templates could be found.
I had the same issue after upgrading nbconvert to 6.0.8.
Rolling back to nbconvert 5.6.1 solved the problem for me.
pip uninstall nbconvert
pip install nbconvert==5.6.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With