import parent modules python code example
Example 1: python reference parent module
$ cat function/bbb.py
import os
import sys
root_folder = os.path.abspath(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root_folder)
from common.aaa import say_hi
say_hi()
Example 2: run a python module with imports from parent
from setuptools import setup, find_packages
setup(name='myproject', version='1.0', packages=find_packages())