nbconvert:ValueError:在以下路径中找不到名为“rst”的模板子目录:[LS个路径]

2024-09-30 06:14:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用nbconvert将标记文件转换为pdf。在代码中,我使用了writer = nbconvert.RSTExporter(),但在使用writer.from_notebook_node()呈现结果时,我遇到了错误:

ValueError: No template sub-directory with name 'rst' found in the following paths:
/Users/hoanguyen/Library/Jupyter
/Users/hoanguyen/miniconda3/envs/d2l-book/share/jupyter #this is my current environment
/usr/local/share/jupyter
/usr/share/jupyter

代码可以在这里看到:https://github.com/d2l-ai/d2l-book/blob/dev/d2lbook/build.py#L653-L657

我安装了nbconvert,pandoc和this instruction,我也安装了Tex

如何为nbconvert安装rst模板?请帮我建议一些解决这个问题的方法

系统信息:

ProductName:    Mac OS X
ProductVersion: 10.15.1
python: 3.6
nbconvert: 6.0.0a3
pandoc: 1.0.2

Tags: 文件代码标记shareusrjupyterrstthis
1条回答
网友
1楼 · 发布于 2024-09-30 06:14:25

出于未知原因,6.0.0及更高版本不包括模板。解决方法是从存储库中的旧版本手动下载它们。(例如v5.6.1

相关问题 更多 >

    热门问题