jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Theme error

Open RalfKellner opened this issue 1 year ago • 1 comments

Describe the bug

context Until today everything worked fine, since today when I build my book, I receive a shinx related error which you can see below. I tried to clean and build, I also uninstalled and reinstalled the package. The error also occurs if I buld a fresh testbook with "jb create testbook". However, it does not occur if I do this in a different folder on my computer. Has anyone an idea, how this may be handled? The error states:

Theme error: An error happened in rendering the page intro. Reason: TemplateNotFound("'static/webpack-macros.html' not found in ['/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/components', PosixPath('/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme'), '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic']") Traceback (most recent call last): File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/html/init.py", line 1119, in handle_page output = self.templates.render(templatename, ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/jinja2glue.py", line 200, in render return self.environment.get_template(template).render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code {%- extends "layout.html" %} ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/layout.html", line 1, in top-level template code {% extends "pydata_sphinx_theme/layout.html" %} ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/../pydata_sphinx_theme/layout.html", line 8, in top-level template code {%- import "static/webpack-macros.html" as _webpack with context %} ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/jinja2glue.py", line 222, in get_source raise TemplateNotFound(msg) jinja2.exceptions.TemplateNotFound: 'static/webpack-macros.html' not found in ['/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/components', PosixPath('/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme'), '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic']

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jupyter_book/sphinx.py", line 167, in build_sphinx app.build(force_all, filenames) File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/application.py", line 351, in build self.builder.build_update() File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 293, in build_update self.build(to_build, File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 362, in build self.write(docnames, list(updated_docnames), method) File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 570, in write self._write_serial(sorted(docnames)) File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 580, in _write_serial self.write_doc(docname, doctree) File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/html/init.py", line 665, in write_doc self.handle_page(docname, ctx, event_arg=doctree) File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/html/init.py", line 1126, in handle_page raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") % sphinx.errors.ThemeError: An error happened in rendering the page intro. Reason: TemplateNotFound("'static/webpack-macros.html' not found in ['/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/components', PosixPath('/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme'), '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme', '/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic']")

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/bin/jb", line 10, in sys.exit(main()) ^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jupyter_book/cli/main.py", line 317, in build builder_specific_actions( File "/Users/ralf/Library/Mobile Documents/com~apple~CloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jupyter_book/cli/main.py", line 528, in builder_specific_actions raise RuntimeError(_message_box(msg, color="red", doprint=False)) from result

Reproduce the bug

  1. Create a virtual environment: python3 -m venv .venv
  2. Install jupyter-book: pip install jupyter-book
  3. Create book: jb create testbook
  4. Build book: jb build testbook

As stated above, I do not expect that this results in an error for everyone, as it seems to be related to my location and the folder I am currently working.

List your environment

jupyter-book 1.0.0

RalfKellner avatar Jun 04 '24 12:06 RalfKellner

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jun 04 '24 12:06 welcome[bot]