Python: relative import

To test relative imports before installing a package, add the source code directory to the path.

For example, import code from a file functions.py in src/mypackage/

import sys
sys.path.append('/Users/username/project/src/')

import mypackage.functions as f