Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve error with downloading Jupyter Notebook as HTML with toc?

When I try to download jupyter notebook as HTML with ToC, it gives a

500 Internal Server Error: nbconvert failed: toc2

I have tried to reinstall nbextensions, upgrade notebook, and tried to download notebook with the File>>Download As method and the command method, all with no luck.

jupyter nbconvert --to html_toc names.ipynb

gives the following error

File "C:\Users\Elle\miniconda3\lib\site-packages\jinja2\loaders.py", line 429, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: toc2

I was able to download as HTML, but unable to do so with ToC. The toc2 folder is in \miniconda3\share\jupyter\nbextensions. The toc2.tpl is in \miniconda3\Lib\site-packages\jupyter_contrib_nbextensions\templates

I am not sure what steps I should follow to have this work.

like image 779
Elle Avatar asked Mar 01 '23 20:03

Elle


1 Answers

After googling, I fixed it by downgrading nbconvert to version 5.6.1

conda install "nbconvert=5.6.1"
like image 166
Elle Avatar answered Apr 19 '23 23:04

Elle