I am trying to import a module from a different directory dynamically. I am following an answer from this question. I have a module named bar in a directory named foo. The m
imp.load_source requires the pathname + file name of the module to import, you should change your source for the one below:
imp.load_source
mod = imp.load_source("bar","./foo/bar.py")