When trying to make a new Jupyter-based presentation using a template I've used in the past, I found that when nbconvert
is upgraded past 6.0, I get an error related to a missing built-in template basic.tpl
. A minimal reproducer for this, create a template file called custom.tpl
:
{% extends 'basic.tpl' %}
Then take any Jupyter notebook and pip install jupyter nbconvert
and run nbconvert notebook.ipynb --to=slides --template=custom.tpl
. You'll get an exception like this:
[NbConvertApp] Converting notebook example.ipynb to slides
Traceback (most recent call last):
File "/tmp/tmp.niaMlxSIbz/venv/bin/jupyter-nbconvert", line 8, in <module>
sys.exit(main())
...
File "/tmp/tmp.niaMlxSIbz/custom.tpl", line 1, in top-level template code
{% extends 'basic.tpl' %}
jinja2.exceptions.TemplateNotFound: basic.tpl
If you pip install 'nbconvert < 6.0'
, you'll find that the same command succeeds.
I imagine this is related to the changes to how templates work that came in 6.0, but I believe that .tpl
templates are still intended to be supported, and there is even a listed PR that restores the basic template, but I can find no instructions anywhere on how to update my template with references to the new location.
Is there some way to fix this by changing the reference to 'basic.tpl'
?
Pinning to 5.6.1 "works", but version 5.6.1 of nbconvert
doesn't work with Python 3.9, and I need access to some of the newer Python features in my notebook.