我正在运行一个 python azure 函数,它通过nbconvertAPI 运行一个 jupyter 笔记本。这已经工作了一段时间,尽管没有部署新代码,我开始收到以下错误:
No template sub-directory with name 'lab' found in the following paths:
/home/.local/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
我用来实现此目的的代码是:
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)
functionapp 正在运行以下内容:
python3.6
nbconvert6.0.3
jupyter-lab0.1.1
我尝试用谷歌搜索错误,到目前为止我发现的最接近的东西是这个,它相似但未得到答复且不完全相同。我想我会在这里发帖看看是否有人知道如何解决或让我更新如果我设法解决问题。
我很困惑,因为lab这不是我熟悉的关键字(在 Maybe 之外jupyterlab)并且没有在代码中使用。
至于提到的路径:
home/.local/share/jupyter/存在并包含nbconvert/templates/html
usr/local/share/jupyter&usr/share/jupyter不存在
预先感谢您的任何帮助!
catspeake
FFIVE
SMILET
慕侠2389804
慕尼黑5688855
红糖糍粑
相关分类