Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 720870 - dev-python/nbconvert-5.2.1: AttributeError: module 'tornado.web' has no attribute 'asynchronous'
Summary: dev-python/nbconvert-5.2.1: AttributeError: module 'tornado.web' has no attri...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-05-03 21:46 UTC by WGH
Modified: 2020-10-29 09:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description WGH 2020-05-03 21:46:46 UTC
when starting jupyter notebook (which depends on nbconvert), the following error occurs:

[E 00:35:25.170 NotebookApp] Uncaught exception GET /notebooks/examples.ipynb?token=0ca183a93fdde5cc291a9a8f882a319666998f7be03a848e (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/examples.ipynb?token=0ca183a93fdde5cc291a9a8f882a319666998f7be03a848e', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/usr/lib64/python3.6/site-packages/tornado/web.py", line 1701, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/lib64/python3.6/site-packages/tornado/web.py", line 3178, in wrapper
        return method(self, *args, **kwargs)
      File "/usr/lib64/python3.6/site-packages/notebook/notebook/handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "/usr/lib64/python3.6/site-packages/notebook/base/handlers.py", line 519, in render_template
        return template.render(**ns)
      File "/usr/lib64/python3.6/site-packages/jinja2/environment.py", line 1090, in render
        self.environment.handle_exception()
      File "/usr/lib64/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception
        reraise(*rewrite_traceback_stack(source=source))
      File "/usr/lib64/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib64/python3.6/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/lib64/python3.6/site-packages/notebook/templates/page.html", line 153, in top-level template code
      File "/usr/lib64/python3.6/site-packages/notebook/templates/notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "/usr/lib64/python3.6/site-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/usr/lib64/python3.6/site-packages/nbconvert/__init__.py", line 7, in <module>
        from . import postprocessors
      File "/usr/lib64/python3.6/site-packages/nbconvert/postprocessors/__init__.py", line 5, in <module>
        from .serve import ServePostProcessor
      File "/usr/lib64/python3.6/site-packages/nbconvert/postprocessors/serve.py", line 18, in <module>
        class ProxyHandler(web.RequestHandler):
      File "/usr/lib64/python3.6/site-packages/nbconvert/postprocessors/serve.py", line 20, in ProxyHandler
        @web.asynchronous
    AttributeError: module 'tornado.web' has no attribute 'asynchronous'

This is because the asynchronous decorator has been removed in Tornado 6.0[1], and the ebuild has only lower Tornado version bound[2], which allows the newer incompatible Tornado version to be installed.

I'll send a pull request fixing it shortly.

[1] https://www.tornadoweb.org/en/stable/releases/v6.0.0.html#tornado-web

Reproducible: Always
Comment 2 WGH 2020-10-29 09:48:25 UTC
dev-python/nbconvert-5.2.1 has been since removed from the portage tree, and the minimum available version is nbconvert-5.6.1, which fixed their code to not depend on deprecated @tornado.web.asynchronous[1].

[1] https://github.com/jupyter/nbconvert/blob/5.6.1/nbconvert/postprocessors/serve.py