question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError when calling `nbgrader feedback`

See original GitHub issue

I am having an issue when trying to create the feedback of graded assignments. Basically I am getting a KeyError every time I try.

Operating system

MacOS 10.13.6

nbgrader --version

v 0.5.5

jupyterhub --version (if used with JupyterHub)

Not using JupyterHub

jupyter notebook --version

v 5.7.8

Expected behavior

Feedback html files should be created in the feedback/ directory when nbgrader feedback ps1 is called.

Actual behavior

I get the following error and the empty /feedback/stu1/ directory is created. Here is the beginning and end of the error.

bash-3.2$ nbgrader autograde ps1
[AutogradeApp | INFO] Skipping existing assignment: /Users/bstone/test_course/my_test_course_1/autograded/stu1/ps1
bash-3.2$ nbgrader feedback ps1
[FeedbackApp | INFO] Copying /Users/bstone/test_course/my_test_course_1/autograded/stu1/ps1/jupyter.png -> /Users/bstone/test_course/my_test_course_1/feedback/stu1/ps1/jupyter.png
[FeedbackApp | INFO] Converting notebook /Users/bstone/test_course/my_test_course_1/autograded/stu1/ps1/problem1.ipynb
[FeedbackApp | ERROR] There was an error processing assignment: /Users/bstone/test_course/my_test_course_1/autograded/stu1/ps1
[FeedbackApp | ERROR] Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nbgrader/converters/base.py", line 293, in convert_notebooks
        self.convert_single_notebook(notebook_filename)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nbgrader/converters/base.py", line 249, in convert_single_notebook
        output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
   :
   :
   :   MISSING CHUNK HERE 
   :
   : 
        <b>Comments:</b> {{ cell.metadata.nbgrader.comment | markdown2html | strip_files_prefix }}
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 74, in markdown2html
        cell = context['cell']
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/jinja2/runtime.py", line 305, in __getitem__
        raise KeyError(key)
    KeyError: 'cell'

[FeedbackApp | WARNING] Removing failed assignment: /Users/bstone/test_course/my_test_course_1/feedback/stu1/ps1
[FeedbackApp | ERROR] There was an error processing assignment 'ps1' for student 'stu1'
[FeedbackApp | ERROR] Please see the error log (.nbgrader.log) for details on the specific errors on the above failures.
bash-3.2$

Steps to reproduce the behavior

  1. Before starting I ran pip install 'SQLAlchemy==1.2.18' according to the issues discussions.
  2. I used the nbgrader quickstart test_course command to create a course.
  3. I added /tmp/exchange directory and modified the config file as per the documentation.
  4. Then assigned the problems with nbgrader assign ps1.
  5. Next I used the Formgrader to release the assignment.
  6. Then created /submitted/stu1/ps1/ via terminal and copied the released assignments (untouched) into this directory.
  7. Using the jupyter interface, I then autograded and manually graded both problem sets in ps1.
  8. Everything worked fine up to here. But when I run nbgrader feedback ps1 I get the above error.

Not sure what I am doing wrong, but any help will be appreciated. Of course if you want the whole error report, I can post it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jhamrickcommented, Jun 19, 2019

What version of nbconvert are you using? (You can find out with jupyter nbconvert --version). If the version you have is 5.5.0, can you try downgrading to 5.4.1 (you can do this with pip install nbconvert==5.4.1)?

For context: there are some issues with the current version of nbconvert that cause errors with nbgrader, which are fixed on the master version of nbconvert but which have not yet been released yet.

0reactions
jhamrickcommented, Aug 21, 2019

This should now be fixed in nbconvert 5.6, so I am going to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nbgrader generate feedback - Read the Docs
Generate feedback from a graded notebook Options ======= The options below ... This function is called after the notebooks are converted and should...
Read more >
python - Key Error - Jupyter Notebook - Stack Overflow
I have started to learn pandas. I am using Jupyter notebook. I have imported the test data file -Weather I read the file...
Read more >
Jupyter Notebook Documentation - Read the Docs
Code is run in a separate process called the Kernel. The Kernel can be interrupted or restarted. Try running the.
Read more >
Getting KeyError: groups from ArcGIS API for Python
KeyError Traceback (most recent call last) /opt/conda/lib/python3.6/site-packages/arcgis/gis/__init__.py in __getitem__(self, ...
Read more >
[listkernelspecs] warning | The AI Search Engine You Control
Feedback. What do you think of this? ... Activating the environment and calling jupyter kernelspec list in the Terminal produces: ... nbgrader --version....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found