python - Jupyter Notebook:ImportError:无法导入名称ConverterMapping
问题描述
在我的 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:内部服务器错误。我在 linux 和编程方面很新。我正在使用 Ubuntu 19.10。我真的很感激任何帮助。谢谢
解决方案
pip install configparser==3.5.0b2
推荐阅读
- java - java项目使用构造函数,它无法运行
- java - 如何在 Java 中继承此方法?
- php - Symfony 路由资源和 Bundle 名称
- python - 如何在极坐标图中正确显示颜色条(半圆的等高线图)?
- visual-studio - #include 检测到错误。请更新您的 includePath
- javascript - 使用 Jest/Enzyme 在按钮单击时监视方法调用
- list - 使用 atomics 将项目添加到 openCL 中的链表会在 uint 中提供混合字节
- java - 最多 k 次买卖股票的最大利润 [递归到 DP]
- android - 从 git 问题克隆 Android Studio 上的 Flutter -Package get' has not been run'
- python - 与 sqlite3 的数据库连接