Jupyter“ 500:内部服务器错误”; “ ImportError:无法导入名称ConverterMapping”(仍然)

时间:2019-11-24 22:25:44

标签: python jupyter-notebook debian

我和here有相同的问题,但是解决方案不起作用。我没有通过apt而是通过pip安装Juypter。我正在尝试打开笔记本,但出现此错误:

[E 23:21:05.164 NotebookApp] Uncaught exception GET /notebooks/examples/WPE_Numpy_offline.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/examples/WPE_Numpy_offline.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/home/foo/.local/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/foo/.local/lib/python2.7/site-packages/tornado/web.py", line 3006, in wrapper
        return method(self, *args, **kwargs)
      File "/home/foo/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "/home/foo/.local/lib/python2.7/site-packages/notebook/base/handlers.py", line 519, in render_template
        return template.render(**ns)
      File "/home/foo/.local/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/home/foo/.local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/home/foo/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/home/foo/.local/lib/python2.7/site-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/home/foo/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "/home/foo/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/home/foo/.local/lib/python2.7/site-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/home/foo/.local/lib/python2.7/site-packages/nbconvert/exporters/__init__.py", line 1, in <module>
        from .base import (export, get_exporter,
      File "/home/foo/.local/lib/python2.7/site-packages/nbconvert/exporters/base.py", line 8, in <module>
        import entrypoints
      File "/usr/lib/python2.7/dist-packages/entrypoints.py", line 16, in <module>
        import configparser
      File "/home/foo/.local/lib/python2.7/site-packages/configparser.py", line 11, in <module>
        from backports.configparser import (
    ImportError: cannot import name ConverterMapping
[E 23:21:05.170 NotebookApp] {
      "Accept-Language": "en-US,en;q=0.5", 
      "Accept-Encoding": "gzip, deflate", 
      "Host": "localhost:8888", 
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0", 
      "Dnt": "1", 
      "Connection": "keep-alive", 
      "Referer": "http://localhost:8888/", 
      "Cookie": "_xsrf=2|e133d90d|5cdab19f4cca62c5c61c790d06b640ac|1574633287; username-localhost-8888=\"2|1:0|10:1574634057|23:username-localhost-8888|44:ZmNkNWZiYjYxZjhmNDRmZWJhNTQ4N2ZiNmJjYjVlNzI=|35565089e95f366be877d52a35e6c85ba6fa132f14d7b3080194e9495b184239\"", 
      "Upgrade-Insecure-Requests": "1"
    }
[E 23:21:05.170 NotebookApp] 500 GET /notebooks/examples/WPE_Numpy_offline.ipynb (::1) 64.98ms referer=http://localhost:8888/

我看到的唯一可疑导入是/usr/lib/python2.7/dist-packages/entrypoints.py,它似乎是全局安装中唯一的导入。我不知道该怎么做。这是在Debian 10上。

0 个答案:

没有答案