Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ipython notebook caching issue

Within ipython notebook I call a function imported from my own module and run some code. I have noticed that if I change the code in the function (outside of notebook) and execute the notebook the old version of the function runs.
Either ipython notebook or firefox seems to be caching the module which I can clear with ctrl-F5, when I remember. Is there an ipython notebook function call to ensure I am running the newest code?

like image 954
Scott Avatar asked Feb 10 '23 13:02

Scott


1 Answers

Put in the following two cells at the beggining of your code and it will automatically reload any new version of your code:

%load_ext autoreload
%autoreload 2
import ...
like image 163
patapouf_ai Avatar answered Feb 13 '23 03:02

patapouf_ai