python - Import not Working - Stack Overflow
stackoverflow.com › questions › 45205702Jul 20, 2017 · All the changes are made exclusively to the file a.py and b.py is not touched. Solution 1: # in file a.py do this import xxx import sys # OR import b (see below) from b import * b = sys.modules[fun.__module__] # alternatively, "import b" and drop "import sys" above # "inject" 'xxx' into 'b': b.__dict__['xxx'] = globals()['xxx'] Solution 2: