Jupyter 笔记本 :当我打开一个存在或创建一个新的 .ipynb 文件时,给我显示一个错误:"500 : invalid continuation byte"



我在我的树莓派4中安装了jupyter笔记本,它可以工作。但在我安装了一些其他包后,jupyter笔记本无法打开ipynb文件(显示:"500:无效的延续字节"(我删除了其他包,甚至重新安装了jupyter笔记型电脑,但错误仍然存在。我想可能有一些配置文件未配置,但我不知道是哪一个。如何修复此错误?谢谢

jupyter笔记本控制台中的错误消息:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 775, in run
yielded = self.gen.send(value)
File "/home/pi/.local/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 101, in get
get_frontend_exporters=get_frontend_exporters
File "/home/pi/.local/lib/python3.7/site-packages/notebook/base/handlers.py", line 516, in render_template
return template.render(**ns)
File "/home/pi/.local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/.local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/.local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/.local/lib/python3.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/home/pi/.local/lib/python3.7/site-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/home/pi/.local/lib/python3.7/site-packages/notebook/templates/notebook.html", line 115, in block "header"
{% for exporter in get_frontend_exporters() %}
File "/home/pi/.local/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 40, in get_frontend_exporters
for name in get_export_names():
File "/home/pi/.local/lib/python3.7/site-packages/nbconvert/exporters/base.py", line 122, in get_export_names
return sorted(entrypoints.get_group_named('nbconvert.exporters'))
File "/usr/lib/python3/dist-packages/entrypoints.py", line 222, in get_group_named
for ep in get_group_all(group, path=path):
File "/usr/lib/python3/dist-packages/entrypoints.py", line 233, in get_group_all
for config, distro in iter_files_distros(path=path):
File "/usr/lib/python3/dist-packages/entrypoints.py", line 199, in iter_files_distros
cp.read([path])
File "/usr/lib/python3.7/configparser.py", line 697, in read
self._read(fp, filename)
File "/usr/lib/python3.7/configparser.py", line 1015, in _read
for lineno, line in enumerate(fp, start=1):
File "/usr/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 0: invalid continuation byte

我检查了ipynb文件,它可以使用python utf-8打开,但我不知道为什么不能在jupyter笔记本下打开。

谢谢弘。你的建议奏效了。我找到了configparser.py打开的文件。结果是"python3.7/site packages/tqdm-4.56.0.dist-info/entry_points.txt";。我删除了文件,jupyter工作正常。

最新更新