![](/img/trans.png)
[英]How to create and open a jupyter notebook ipynb file directly from terminal
[英]Jupyter notebook : when i open an exist or create a new .ipynb file, show me an error: “500 : invalid continuation byte”
我在我的树莓派 4 中安装了 jupyter notebook,它可以工作。 但是在我安装了其他一些package之后,jupyter笔记本无法打开ipynb文件(显示:“500:无效的继续字节”)我删除了其他package,甚至重新安装了jupyter笔记本,但错误仍然存在。 我猜可能有一些配置文件未配置,但我不知道是哪一个。 我该如何解决这个错误? 谢谢。
jupyter notebook 控制台中的错误消息:
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 notebook下打不开。
谢谢宏。 你的建议奏效了。 我找到了哪个文件 configparser.py 打开了。 结果是“python3.7/site-packages/tqdm-4.56.0.dist-info/entry_points.txt”。 我删除了文件,jupyter 工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.