function
import inspect from sys import path from os.path import abspath, dirname currentdir = dirname(abspath(inspect.getfile(inspect.currentframe()))) parentdir = dirname(currentdir) path.insert(0, parentdir) from conf.value import OK, ERROR
Importing modules from parent folder
I posted a similar answer also to the question regarding imports from sibling packages. You can see it here. The following is tested with Python 3.6.5, (Anaconda, conda 4.5.1), Windows 10 machine. I assume the same folder structure as in the question .
https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder
