gpt4 book ai didi

python - IPython Notebook 1.1.0 向后不兼容 1.0 吗?我收到 "unreadable notebook"错误

转载 作者:太空宇宙 更新时间:2023-11-03 18:36:53 25 4
gpt4 key购买 nike

我使用 pip install 在 Ubuntu 12.04 上安装了 IPython 1.1.0。我可以打开下载的 IPython 笔记本,例如来自here ,或者创建我自己的。一切正常运行,没有任何错误消息。

但是,当尝试使用我下载的笔记本时 here ,我收到一条错误消息

 Unreadable Notebook: Notebook does not appear to be JSON: '{\n "metadata": {'

查看编辑器上的内容,正确打开的笔记本具有以下结构:

{
"metadata": {
"name": "Basics"
},
"nbformat": 2,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy as np"
],
"language": "python",
"outputs": [],
"prompt_number": 3
}
]
}
]
}

而给我错误消息的那些看起来像这样(简化,但符合原始规则):

{
"metadata": {
"name": "Basics"
},
"nbformat": 2,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"language": "python",
"outputs": [],
"collapsed": False,
"prompt_number": 10,
"input": [
"import numpy as np"
],
"metadata": {}
}
]
}
]
}

这是版本兼容性问题吗?最明显的区别是笔记本中有一个不运行的“元数据”字段。有没有办法运行这些不被识别为 JSON 的笔记本(除了删除所有“元数据”:{} 条目)?

最佳答案

metadata 字段是可选的,不会改变任何事情。您看到的错误(通常)是由于 javascript 文件中的陈旧缓存(强制刷新)造成的。我可以在 IPython master 上打开链接的笔记本,并立即重新保存它 here如果你想尝试的话。

关于python - IPython Notebook 1.1.0 向后不兼容 1.0 吗?我收到 "unreadable notebook"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21399312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com