If I import a module defining a class of the same name belonging to a package, it is imported as a Class, not a Module because of the __init__.py of the parent package. See
There are thee ways to solve this:
import MyPak.MyMod instead of from MyPak import MyModThen you can write:
from importlib import reload # If on Python 3
import MyPak.MyMod
reload(MyPak.MyMod)
and it works.
from MyPak import MyMod
from IPython.lib.deepreload import reload
reload(MyPak) # This should also reload all submodules
%load_ext autoreload
%autoreload 2
import MyPak.MyMod # All changes to MyPak.MyMod will be loaded automatically