如何在iPython中使用deepreload进行自动重载

时间:2018-05-03 22:09:22

标签: python ipython jupyter-notebook jupyter

我目前使用它在python中自动加载

%reload_ext autoreload
%autoreload 2

但是,我想开始使用deepreload(https://ipython.org/ipython-doc/3/api/generated/IPython.lib.deepreload.html

但是以下不起作用:

import builtins
from IPython.lib import deepreload
builtins.reload = deepreload.reload

%reload_ext autoreload
%autoreload 2

如何在jupyter中获得深度自动加载

1 个答案:

答案 0 :(得分:0)

只需颠倒顺序

%load_ext autoreload
%autoreload 2

import builtins
from IPython.lib import deepreload
builtins.reload = deepreload.reload