#1001229 python3-nbconvert: 500 error when opening a notebook

#1001229#5
Date:
2021-12-06 17:50:56 UTC
From:
To:
Dear Maintainer,

today I wanted to work again with my jupyter notebooks but when I try to open a notebook in the browser, I get a 500 internal server error and the log in the console where I started jupyter-notebook shows the following messages:

[guefz@corinnis:~/data/mineral] $ jupyter-notebook --no-browser --notebook-dir python-test/
[I 18:00:53.844 NotebookApp] Serving notebooks from local directory: /home/guefz/data/mineral/python-test
[I 18:00:53.844 NotebookApp] Jupyter Notebook 6.4.5 is running at:
[I 18:00:53.844 NotebookApp] http://localhost:8888/?token=01856103749006da3a0beaa7d83256462324e12ef589fa11
[I 18:00:53.844 NotebookApp]  or http://127.0.0.1:8888/?token=01856103749006da3a0beaa7d83256462324e12ef589fa11
[I 18:00:53.844 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:00:53.847 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///home/guefz/.local/share/jupyter/runtime/nbserver-48274-open.html
    Or copy and paste one of these URLs:
http://localhost:8888/?token=01856103749006da3a0beaa7d83256462324e12ef589fa11
     or http://127.0.0.1:8888/?token=01856103749006da3a0beaa7d83256462324e12ef589fa11
[I 18:01:14.453 NotebookApp] 302 GET /?token=01856103749006da3a0beaa7d83256462324e12ef589fa11 (127.0.0.1) 0.710000ms
[E 18:01:17.588 NotebookApp] Uncaught exception GET /notebooks/test-pyqtgraph2.ipynb (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/test-pyqtgraph2.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/tornado/web.py", line 1704, in _execute
        result = await result
      File "/usr/lib/python3/dist-packages/tornado/gen.py", line 775, in run
        yielded = self.gen.send(value)
      File "/usr/lib/python3/dist-packages/notebook/notebook/handlers.py", line 95, in get
        self.write(self.render_template('notebook.html',
      File "/usr/lib/python3/dist-packages/notebook/base/handlers.py", line 516, in render_template
        return template.render(**ns)
      File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1304, in render
        self.environment.handle_exception()
      File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 925, in handle_exception
        raise rewrite_traceback_stack(source=source)
      File "/usr/lib/python3/dist-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/lib/python3/dist-packages/notebook/templates/page.html", line 153, in top-level template code
        {% block header %}
      File "/usr/lib/python3/dist-packages/notebook/templates/notebook.html", line 115, in block 'header'
        {% for exporter in get_frontend_exporters() %}
      File "/usr/lib/python3/dist-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/usr/lib/python3/dist-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/usr/lib/python3/dist-packages/nbconvert/exporters/__init__.py", line 3, in <module>
        from .html import HTMLExporter
      File "/usr/lib/python3/dist-packages/nbconvert/exporters/html.py", line 14, in <module>
        from nbconvert.filters.highlight import Highlight2HTML
      File "/usr/lib/python3/dist-packages/nbconvert/filters/__init__.py", line 6, in <module>
        from .markdown import *
      File "/usr/lib/python3/dist-packages/nbconvert/filters/markdown.py", line 13, in <module>
        from .markdown_mistune import markdown2html_mistune
      File "/usr/lib/python3/dist-packages/nbconvert/filters/markdown_mistune.py", line 31, in <module>
        class MathBlockGrammar(mistune.BlockGrammar):
    AttributeError: module 'mistune' has no attribute 'BlockGrammar'
[E 18:01:17.594 NotebookApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "Accept-Language": "de,en-US;q=0.7,en;q=0.3",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8888/tree",
      "Dnt": "1",
      "Connection": "keep-alive",
      "Cookie": "username-localhost-8888=\"2|1:0|10:1638810074|23:username-localhost-8888|44:MzcyMTZhNWZlMDk0NGI0ZjhmZjg3ZmIyODQ3YTYxY2I=|7d1e98fc5a0ea3e90e787261d33c200d2e096fc98e98a9185e6380c563b6d276\"; _xsrf=2|a5a9d73d|b4645908e0d526989c0ee2051ac0574f|1638810074",
      "Upgrade-Insecure-Requests": "1",
      "Sec-Fetch-Dest": "document",
      "Sec-Fetch-Mode": "navigate",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-User": "?1"
    }
[E 18:01:17.594 NotebookApp] 500 GET /notebooks/test-pyqtgraph2.ipynb (127.0.0.1) 72.870000ms referer=http://localhost:8888/tree

Regards

Günter

#1001229#10
Date:
2021-12-08 22:24:23 UTC
From:
To:
Hi,

I think this bug should be merged with #1001283
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001283

I can confirm that a downgrade of python3-mistune to version 0.8.5-5
solves the problem for now.

Regards Günter

#1001229#15
Date:
2022-07-14 12:28:30 UTC
From:
To:
Hi,

since bug #1001283 has been fixed, this other bug is fixed too.

Cheers,

J.Puydt