问题描述
我正在使用 nbconvert
将markdown文件转换为pdf.在代码中,我使用了 writer = nbconvert.RSTExporter()
,但是当使用 writer.from_notebook_node()
渲染结果时,我遇到了错误:
I am using nbconvert
to convert markdown file to pdf. In the code I used writer = nbconvert.RSTExporter()
but when render the result with writer.from_notebook_node()
, I faced the error:
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
The code can be seen here: https://github.com/d2l-ai/d2l-book/blob/dev/d2lbook/build.py#L653-L657
我安装了 nbconvert
,通过此说明,我也确实安装了 Tex
.
I installed nbconvert
, pandoc with this instruction and I did have Tex
installed as well.
如何为 nbconvert
安装 rst
模板?请帮我建议一些解决此问题的方法吗?
How can I install rst
template for nbconvert
? Please help me suggest some workarounds for this issue?
系统信息:
ProductName: Mac OS X
ProductVersion: 10.15.1
python: 3.6
nbconvert: 6.0.0a3
pandoc: 1.0.2
推荐答案
由于某些未知原因,6.0.0及更高版本不包含模板.一种解决方法是从存储库中的旧版本手动下载它们.(例如 v5.6.1 )
For some unknown reason, the versions from 6.0.0 and on don't include the templates. A workaround is to download them manually from older versions in the repository. (e.g. v5.6.1)
这篇关于nbconvert:ValueError:在以下路径中找不到名称为"rst"的模板子目录:[LS OF PATHS]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!