title: Proper imports in an installable python project
body: <p>I'm trying to clean a python project on pypi to make it installable. It has the following structure (very simplified)</p>
  <pre><code>project_x/
    project_x/
      pack_a/
        __init__.py
        mod_a1.py
        mod_a2.py
      pack_b/
        __init__.py
        mod_b.py
    setup.py
    README
    ...
  </code></pre>
  <p>In <code>mod_a1.py</code> there is something like <code>from pack_a.mod_a2 import something</code>.
  So I added, to the setup.py, the line <code>package_dir: {&quot;&quot;: &quot;project_x&quot;}</code> for this to work.</p>
  <p>However, <code>mod_b.py</code> uses relative imports: <code>from ..pack_a.mod_a import ...</code>.
  This fails with
  <code>ImportError: attempted relative import beyond top-level package</code></p>
  <p>What is the correct way to handle this? Avoid using relative imports? Writing full paths, such a <code>from project_x.pack_a import...</code> everywhere? Or something smart in the setup.py?</p>