def reload_package(root_module):
    package_name = root_module.__name__
loaded_package_modules = dict([(key, value) for key, value in list(sys.modules.
    items()) if key.startswith(package_name) and isinstance(value, types.
    ModuleType)])
for key in loaded_package_modules:
    del sys.modules[key]
for key in loaded_package_modules:
    print('loading %s' % key)
newmodule = __import__(key)
oldmodule = loaded_package_modules[key]
oldmodule.__dict__.clear()
oldmodule.__dict__.update(newmodule.__dict__)
Запретить Python кэшировать импортированные модули