【问题标题】:nbconvert: ValueError: No template sub-directory with name 'rst' found in the following paths: [LS OF PATHS]nbconvert:ValueError:在以下路径中找不到名为“rst”的模板子目录:[LS OF PATHS]
【发布时间】:2020-06-17 14:15:55
【问题描述】:

我正在使用nbconvert 将markdown 文件转换为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

【问题讨论】:

  • 您可以安装旧版本的 nbconvert,因为类似的错误 5.6.1 适合我。
  • 这也救了我。谢谢@Joost

标签: python jupyter-notebook restructuredtext nbconvert


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2021-01-05
    • 2017-03-05
    • 2013-06-17
    • 1970-01-01
    • 1970-01-01
    • 2016-06-18
    • 1970-01-01
    • 1970-01-01
    • 2020-12-07
    相关资源
    最近更新 更多