Since IPython Notebook does not reload the file after I modified my module, I am trying to reload it. There was a post on how to do similar things, but my problem is when the .py file is in a subfolder, it does not work.
My original import works like this:
from myutils.MyClassFile import MyClass
while trying to reload:
reload(myutils.MyClassFile)
from myutils.MyClassFile import MyClass
I got the error:
name 'myutils' is not defined
Any suggestion on how to achive this.
In the notebook:
%load_ext autoreload
%autoreload 2
enables auto reload of all imported modules that changed for each execution of a cell.
You can exclude modules with:
%aimport module_to_exclude
Alternatively use:
%autoreload 1
and whitelist what should be reloaded:
%aimport module_to_include
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With