Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jinja2.exceptions.TemplateNotFound: formgrade #1382

Closed
OptimusPrimus opened this issue Oct 18, 2020 · 1 comment
Closed

jinja2.exceptions.TemplateNotFound: formgrade #1382

OptimusPrimus opened this issue Oct 18, 2020 · 1 comment

Comments

@OptimusPrimus
Copy link

Operating system

Ubuntu 20.04.1 LTS.

nbgrader --version

nbgrader version 0.6.1

jupyterhub --version (if used with JupyterHub)

n.a.

jupyter notebook --version

6.1.4

Expected behavior

When clicking on Manual Grading > ps1 > Problem 1 > Submission #1 the interface for manual grading should open.

Actual behavior

However, I get an error page with the error message Sorry, the formgrader encountered an error. Please contact the administrator of the formgrader for further assistance.

Jupyter notebook outputs the following error message:

 [E 16:48:47.716 NotebookApp] Uncaught exception GET /formgrader/submissions/5e4366763f3d4591a51127cca26c5df0/ (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/formgrader/submissions/5e4366763f3d4591a51127cca26c5df0/', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/paul/miniconda3/lib/python3.8/site-packages/tornado/web.py", line 1701, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/tornado/web.py", line 3178, in wrapper
        return method(self, *args, **kwargs)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbgrader/server_extensions/formgrader/base.py", line 108, in wrapper
        return f(self, *args, **kwargs)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbgrader/server_extensions/formgrader/base.py", line 117, in wrapper
        return f(self, *args, **kwargs)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbgrader/server_extensions/formgrader/handlers.py", line 125, in get
        html, _ = self.exporter.from_filename(filename, resources=resources)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 181, in from_filename
        return self.from_file(f, resources=resources, **kw)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 199, in from_file
        return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/html.py", line 119, in from_notebook_node
        return super().from_notebook_node(nb, resources, **kw)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 384, in from_notebook_node
        output = self.template.render(nb=nb_copy, resources=resources)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 148, in template
        self._template_cached = self._load_template()
      File "/home/paul/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 355, in _load_template
        return self.environment.get_template(template_file)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 883, in get_template
        return self._load_template(name, self.make_globals(globals))
      File "/home/paul/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 857, in _load_template
        template = self.loader.load(self, name, globals)
      File "/home/paul/miniconda3/lib/python3.8/site-packages/jinja2/loaders.py", line 429, in load
        raise TemplateNotFound(name)
    jinja2.exceptions.TemplateNotFound: formgrade
[E 16:48:47.717 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Upgrade-Insecure-Requests": "1",
      "Dnt": "1",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-Mode": "navigate",
      "Sec-Fetch-User": "?1",
      "Sec-Fetch-Dest": "document",
      "Referer": "http://localhost:8888/formgrader/gradebook/ps1/Problem%201",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "de-AT,de-DE;q=0.9,de;q=0.8,en-US;q=0.7,en;q=0.6",
      "Cookie": "_xsrf=2|8636a060|9f48a91edc7258d7f57924c5d8fc5f9c|1603024649; username-localhost-8888=\"2|1:0|10:1603031692|23:username-localhost-8888|44:ZTc3ZDU2YzdiOTAyNDUwMmEyMjgzZDE4NDUxYjk1ZWQ=|910c49e636b3163679a9025deecdb19c253ed4cbc11dc244bde3c0584fd24f7d\""
    }

Steps to reproduce the behavior

Set up the environment:

conda create --name pm
conda activate pm

conda install jupyter -y
conda install -c conda-forge nbgrader -y

jupyter nbextension install --sys-prefix --py nbgrader --overwrite
jupyter nbextension enable --sys-prefix --py nbgrader
jupyter serverextension enable --sys-prefix --py nbgrader

Then, create a test assignment, release it & do the auto-grading. Click on Manual Grading > ps1 > Problem 1 > Submission #1 and the error message will pop up.

Thanks for any hints!
Cheers,
Paul

@OptimusPrimus
Copy link
Author

setting up the environment with version 5.6.1 of nbconvert fixed the issue for me...

conda install jupyter nbconvert=5.6.1 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants