升级后无法读取 Jupyter Lab Notebook pandas(捕获验证错误)

unreadable Jupyter Lab Notebook after upgrading pandas (Capture Validation Error)

我最近在使用 Jupyter 实验室,并决定将我的 pandas 版本从 1.2 更新到最新的 (1.4)。所以我 运行 'conda update pandas' 似乎工作正常。然而,当我以通常的方式 'jupyter lab' 启动 Jupyter lab 并尝试打开我刚刚处理的工作簿时,我收到以下错误:

Unreadable Notebook: C:\Users...\script.ipynb TypeError("init() got an unexpected keyword argument 'capture_validation_error'")

我在尝试打开以前工作正常的任何 .ipynb 文件时遇到同样的错误。我也可以在 jupyter notebook 中很好地打开它们,但由于某种原因,它们不再在 Jupyter lab 中工作。知道我该如何解决这个问题吗?

谢谢

事实证明,最近对 jupyter_server>=1.15.0 的更新破坏了与 nbformat<5.2.0 的兼容性,但没有根据 this Github pull request.[=21= 正确更新 conda 配方]

您可能在更新 pandas 的同时无意中也更新了 jupyterlab and/or jupyter_server.

当我们等待带有合并 PR 的构建到达下游时,我们可以通过使用

手动更新 nbformat 来解决这个依赖问题
conda install -c conda-forge nbformat

获取 nbformat 的最新版本 >=5.2

我遇到了同样的问题。我已经使用 conda 安装了 jupyterlab。

conda install -c conda-forge jupyterlab

而且我无法打开任何笔记本(新创建的旧笔记本)。解决我的问题的方法是卸载 jupyterlab 和 jupyter,然后重新安装 jupyter lab。

conda remove jupyterlab
conda remove jupyter
conda install -c conda-forge jupyterlab