Redirect a Python import by using a dummy Python module that deletes its own reference and replaces it with relative module or package.
Allows more control over a relative directory structure
The directory structure being used:
root/ test.py foo/ __init__.py foo/ __init__.py
The initial import is in /root/test.py. From inside /root/foo/_init_.py, we redirect to /root/foo/foo .