Reload module from a folder?
Question: Since IPython Notebook does not reload the file after I modified my module, I
am trying to reload it. There was a
[post](http://stackoverflow.com/questions/5516783/how-to-reload-python-module-
imported-using-from-module-import) 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.


Answer: 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
    

