Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use deepreload for autoreload in iPython

I currently use this to autoreload in python

%reload_ext autoreload
%autoreload 2

however, I would like to start using deepreload (https://ipython.org/ipython-doc/3/api/generated/IPython.lib.deepreload.html)

However the below does not work:

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

%reload_ext autoreload
%autoreload 2

How can I get deep autoreload in jupyter

like image 948
samol Avatar asked Oct 17 '22 19:10

samol


1 Answers

Just reverse the order

%load_ext autoreload
%autoreload 2

import builtins
from IPython.lib import deepreload
builtins.reload = deepreload.reload
like image 50
sheridp Avatar answered Oct 20 '22 16:10

sheridp