Jupyter Notebook:500内部服务器错误

时间:2019-03-15 15:09:22

标签: python jupyter-notebook

当我在浏览器中看到“ 500:内部服务器错误”时,我试图在Jupyter Notebook中打开.ipynb文件。

终端中的错误消息:

[C 23:01:41.750 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/Valeera/AppData/Roaming/jupyter/runtime/nbserver-6072-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=c33d644eeb15c66ec4f8764c7e83023f729f162bbc122f38
[E 23:01:44.821 NotebookApp] Uncaught exception GET /notebooks/1700012779.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/1700012779.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\tornado\web.py", line 1697, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\tornado\web.py", line 3174, in wrapper
        return method(self, *args, **kwargs)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\notebook\notebook\handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 462, in render_template
        return template.render(**ns)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
        return original_render(self, *args, **kwargs)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\jinja2\environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\jinja2\_compat.py", line 37, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\notebook\templates\notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\notebook\templates\page.html", line 154, in top-level template code
        {% block header %}
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\notebook\templates\notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\notebook\notebook\handlers.py", line 19, in get_custom_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\nbconvert\__init__.py", line 7, in <module>
        from . import postprocessors
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\nbconvert\postprocessors\__init__.py", line 5, in <module>
        from .serve import ServePostProcessor
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\nbconvert\postprocessors\serve.py", line 19, in <module>
        class ProxyHandler(web.RequestHandler):
      File "C:\Users\Valeera\Anaconda3\lib\site-packages\nbconvert\postprocessors\serve.py", line 21, in ProxyHandler
        @web.asynchronous
    AttributeError: module 'tornado.web' has no attribute 'asynchronous'
[E 23:01:44.833 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Upgrade-Insecure-Requests": "1",
      "Dnt": "1",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
      "Referer": "http://localhost:8888/tree",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
      "Cookie": "_xsrf=2|2008cea6|390d6f74fcb21ba19bd6f0383f3c2abd|1552660846; username-localhost-8888=\"2|1:0|10:1552662103|23:username-localhost-8888|44:YjUyZWQzMmVhYzYxNDY5NDk4ZGNkNDFhMzhhZWUyOWY=|048e17c293599d50a07b2f0a1cbcdaadbb04e21f8a3b167947e1caee099b442f\""
    }

模块'tornado.web'似乎出了点问题,我完全不知道。有人可以告诉我该怎么做才能再次使我的Jupyter Notebook工作?

1 个答案:

答案 0 :(得分:2)

这似乎已在其他地方报道:https://github.com/conda-forge/nbconvert-feedstock/issues/27

(编辑:https://github.com/jupyter/notebook/issues/4311

原因似乎是某些版本不兼容,涉及nbconvert,pandoc等。