voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.41k stars 503 forks source link

TemplateNotFound error with JupyterLab 4.1.6 notebooks #1465

Open neelasha23 opened 5 months ago

neelasha23 commented 5 months ago

Description

When running voila app.ipynb on notebooks generated with JupyterLab 4.1.6 (latest version) I get this error:

  File "/Users/neelashasen/Dev/doc/examples/voila/docker-based/env2/lib/python3.11/site-packages/nbconvert/exporters/templateexporter.py", line 380, in _load_template
    return self.environment.get_template(template_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/neelashasen/Dev/doc/examples/voila/docker-based/env2/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/neelashasen/Dev/doc/examples/voila/docker-based/env2/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/neelashasen/Dev/doc/examples/voila/docker-based/env2/lib/python3.11/site-packages/jinja2/loaders.py", line 575, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: index.html.j2

Reproduce

  1. Created a clean virtual environment.
  2. Installed latest versions of voila and jupyterlab.
  3. Create a simple notebook with below code:

iris = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv') iris


4. Run `voila app.ipynb`

Repeated the same steps with a notebook generated with JupyterLab 4.0.0 and didn't face this issue

<!--Describe how you diagnosed the issue -->

## Expected behavior

No error

## Context

<!--Complete the following for context, and add any other relevant context-->

- voila version <!-- import voila; print(voila.__version__)-->: 0.5.6
- Operating System and version: Mac M1
- Browser and version: Google Chrome

<details><summary>Troubleshoot Output</summary>
<pre>
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
</pre>
</details>

<details><summary>Command Line Output</summary>
<pre>
Paste the output from your command line running `voila` here, use `--debug` if possible.
</pre>
</details>

<details><summary>Browser Output</summary>
<pre>
Paste the output from your browser Javascript console here.
</pre>
</details>

### If using JupyterLab
- JupyterLab version: 4.1.6

<details><summary>Installed Labextensions</summary>
<pre>
Paste the output from your command line running `jupyter labextension list`.
</pre>
</details>