For me, importlib.reload()
did not work.
I found that the following code (adapted from here) worked.
import sys
all_modules = sys.modules
all_modules = dict(sorted(all_modules.items(),key= lambda x:x[0]))
for k,v in all_modules.items():
if k.startswith('andy'):
del sys.modules[k]
import andy
andy.mine()