Closed vEpiphyte closed 4 years ago
Hey @vEpiphyte thanks for reporting!
The way custom templates are done is one of the main changes in nbconvert 6.0, and the main reason for the major version bump indicating backward incompatibility. You can check out the documentation here: https://nbconvert.readthedocs.io/en/latest/customizing.html There is also a tutorial in the works on how to create more sophisticated templates.
I'm seeing the same problem on a Mac.
After installing transitively nbconvert 6.0.1 from installing jupyter with:
pip install --user pytest jupyter
when I try to use jupyter nbconvert Notebook.ipynb --execute --stdout --to html
I get a ValueError: No template sub-directory with name 'lab' found in the following paths:
looking into the templates paths, like /usr/local/share/jupyter/nbconvert/templates/html/
; they are empty. From the documentation seems to me there should be some directories in it with files for the templates.
How are the templates supposed to get there? Are they part of another package that is missing, or are they not getting copied during installation?
@anpaz-msft thanks for reporting. Your issue is unrelated to the original one (which was expected behavior). Yours appear to be a legitimate bug with --user
installes of nbconvert. I am closing this one and opening another related to user installs.
@anpaz-msft actually, I am not reproducing your issue.
Could you please report the output to
which jupyter
jupyter --paths
and the content of your ~/.local/share/jupyter/nbconvert/templates
directory?
@SylvainCorlay Thanks for following up. I look forward to seeing the tutorial about migrating old templates.
I'm seeing the same problem on a Mac. After installing transitively nbconvert 6.0.1 from installing jupyter with:
pip install --user pytest jupyter
when I try to usejupyter nbconvert Notebook.ipynb --execute --stdout --to html
I get aValueError: No template sub-directory with name 'lab' found in the following paths:
looking into the templates paths, like/usr/local/share/jupyter/nbconvert/templates/html/
; they are empty. From the documentation seems to me there should be some directories in it with files for the templates. How are the templates supposed to get there? Are they part of another package that is missing, or are they not getting copied during installation?
I had the same problem on Windows 10, and after reading @SylvainCorlay reply, I unistall nbconvert and then reinstalled it without the flag --user
and it worked. Every template appers and I was able to convert my notebook.
I think @SylvainCorlay is correct, something goes wrong when using the --user
.
My directory ...\share\jupyter\nbconvert\templates
was empty before my ''fix''.
Tutorials, docs updates, and some fixes for a few issues related to this have all been resolved. I'm going to close this issue as I believe it's addressed
I faced the same issue using nbconvert version 6.0.7
.
ValueError: No template sub-directory with name 'report' found in the following paths:
I used the command suggested in docs:
jupyter-nbconvert --to pdf --no-input --no-prompt --template report nb.ipynb
However, rolling back to version 5.6.1
fixed the error.
However, rolling back to version
5.6.1
fixed the error.
The same on Windows 10 (without admin rights). 5.6.1 fixed the issue, while 6+ versions are still bagged.
When executing nbconvert to convert a jupyter notebook into RST format with a custom template that extends
rst.tpl
, I receive an exception forjinja2.exceptions.TemplateNotFound: display_priority.j2
. We are using a custom template to extend therst.tpl
file in order to surpress output blocks in the RST output which have been marked with thehide_code
jupyter extension. Since we run notebooks as part of our unittests to ensure our documentation is up-to-date, this is causing build failures for our project (vertexproject/synapse). This can be seen in https://github.com/vertexproject/synapse/pull/1876 and https://app.circleci.com/pipelines/github/vertexproject/synapse/4660/workflows/dcb1e54f-fc51-49fd-9134-e88ef80c5c7d/jobs/19312This is the custom template file
We're not currently constraining the version of the nbconvert library installed, instead relying on the packages installed by installing the
jupyter
library.I do not have a minimal test case example, but it is reproducible.
This eventually fails with the following error
Executing the conversion without the
--template
argument provided does work to convert the notebook, but includes the information I want to drop.I did try modifying the
index.rst.j2
file to load'base/display_priotiy.j2
and that did successfully execute my builds, but I don't know if that change has other ramifications for nbconvert at a larger scale or not.This is using nbconvert 6.0.1. I have also confirmed that 6.0.0 also fails. 5.6.1 worked fine.
The following is a dump of libraries from
python -m pip freeze
the venv used above