title: How to import python modules from parent and sibling packages
body: <p>This (or similar) question has been asked many times before, but none of the solutions offered work in my case.
  My project structure is like this : </p>
  
  <pre><code>| project_2
        main.py
        __init__.py
        systems.py
        | config
              __init__.py
              options.py
        | database
              __init__.py
              database.py
              entity.py
        | tests
              __init__.py
              test_systems.py
              test_options.py
              test_database.py
              test_entity.py
  </code></pre>
  
  <p>Obviously I need to import all the modules in the test modules under the tests package. I tried relative imports with the dot syntax:</p>
  
  <pre><code>from ..systems import System
  from ..config import options
  from ..database.entity import Entity
  </code></pre>
  
  <p>Returns a ValueError: Attempt relative import in non-package. I have tried that with a package structure where everything (including systems) is in its own package. It fails with the same message.</p>
  
  <p>What really bothers me is that this is supposed to work: <a href="http://www.python.org/dev/peps/pep-0328/" rel="nofollow">PEP 328</a>, but it does not. I really want to avoid having to append the packages to $PYTHONPATH or to use some insane method such as loading the modules with imp from the file path.</p>
  
  <p>I read that part of the problem might be that systems.py is in the main package, but that does not explain why the rest of the relative imports do not work either. </p>
  
  <p>P.S. I actually recreated the example from PEP 328 just to test it and it does not work. </p>