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
Appears to be a simple pathing problem - check __file__
or cwd... Maybe try an absolute file path first? - This imp example may help.
imp.load_source
requires the pathname + file name of the module to import, you should change your source for the one below:
mod = imp.load_source("bar","./foo/bar.py")