Jupyter Notebook:ImportError:无法导入名称ConverterMapping

时间:2019-12-01 18:20:42

标签: python ubuntu jupyter-notebook ipython jupyter

在Ubuntu上安装Jupyter Notebook之后,出现此错误

[E 18:56:47.063 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1590, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 3006, in wrapper
        return method(self, *args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/notebook/notebook/handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "/usr/local/lib/python2.7/dist-packages/notebook/base/handlers.py", line 519, in render_template
        return template.render(**ns)
      File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python2.7/dist-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/local/lib/python2.7/dist-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/usr/local/lib/python2.7/dist-packages/notebook/templates/notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "/usr/local/lib/python2.7/dist-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/home/przemysaw_cz/.local/lib/python2.7/site-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/home/przemysaw_cz/.local/lib/python2.7/site-packages/nbconvert/exporters/__init__.py", line 1, in <module>
        from .base import (export, get_exporter,
      File "/home/przemysaw_cz/.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 "/usr/local/lib/python2.7/dist-packages/configparser.py", line 11, in <module>
        from backports.configparser import (
    ImportError: cannot import name ConverterMapping
[E 18:56:47.084 NotebookApp] {
      "Accept-Language": "pl,en-US;q=0.7,en;q=0.3", 
      "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; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0", 
      "Connection": "keep-alive", 
      "Referer": "http://localhost:8888/tree", 
      "Cookie": "_xsrf=2|7b1c2f7c|c2cd7e4dd38651ebcba8338d18fb015e|1575218851; username-localhost-8888=\"2|1:0|10:1575222999|23:username-localhost-8888|44:YWE4NDE5YTQzYTliNDJjZTkxY2MwMDk1Y2IwMTcyY2U=|bd4ceeb3b54a9823a83dc77bd9a404dc087e520fa3d677179176f23c2d605fc7\"", 
      "Upgrade-Insecure-Requests": "1"
    }
[E 18:56:47.085 NotebookApp] 500 GET /notebooks/Untitled.ipynb (127.0.0.1) 346.92ms referer=http://localhost:8888/tree
[Parent 10103, Gecko_IOThread] WARNING: pipe error (131): Połączenie zerwane przez drugą stronę: file /build/firefox-cfmLQt/firefox-70.0.1+build1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
[Parent 10103, Gecko_IOThread] WARNING: pipe error (65): Połączenie zerwane przez drugą stronę: file /build/firefox-cfmLQt/firefox-70.0.1+build1/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358

我尝试了许多方法来解决此错误500:Internal Server Error。我在linux和编程方面是新手。我正在使用Ubuntu 19.10。 我真的很感谢您的帮助。 谢谢

1 个答案:

答案 0 :(得分:1)

pip install configparser == 3.5.0b2

相关问题