首页 > 解决方案 > AttributeError:模块“IPython.core”没有属性“shadowns”

问题描述

我正在运行这些行

import dill
dill.load_session("session2.pkl")

并得到错误 AttributeError: module 'IPython.core' has no attribute 'shadowns'。我已将此会话保存在 Google Colab Notebooks 上。我怎样才能摆脱错误?

标签: pythonipythongoogle-colaboratoryjupyter-labdill

解决方案


我使用了简单的解决方法:

import IPython
IPython.core.shadowns = 1

对于像googleor这样的一些额外的包google.colab,我使用了

%%bash
mkdir google/colab
touch google/colab/__init__.py

推荐阅读