I\'m trying to follow PEP 328, with the following directory structure:
pkg/ __init__.py components/ core.py __init__.py tests/ core_test.py
You can use import components.core directly if you append the current directory to sys.path:
import components.core
sys.path
if __name__ == '__main__' and __package__ is None: from os import sys, path sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))