4

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

The code can be seen here: https://github.com/d2l-ai/d2l-book/blob/dev/d2lbook/build.py#L653-L657

I installed nbconvert, pandoc with this instruction and I did have Tex installed as well.

How can I install rst template for nbconvert? Please help me suggest some workarounds for this issue?

System information:

ProductName:    Mac OS X
ProductVersion: 10.15.1
python: 3.6
nbconvert: 6.0.0a3
pandoc: 1.0.2
Hoa Nguyen
  • 310
  • 3
  • 11

1 Answers1

4

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)