title: Right way to set python package with sub-packages
body: <p>I am trying to set a package with sub-packages in python. Here is the tree structure that I have at the moment:</p>
  
  <pre><code>myPackage
  ├── __init__.py
  ├── mySubPackage1
  │   ├── foo2.py
  │   ├── foo.py
  │   └── __init__.py
  ├── mySubPackage2
  │   ├── bar2.py
  │   ├── bar.py
  │   └── __init__.py
  └── setup.py
  </code></pre>
  
  <p>All <code>__init__.py</code> are empty. Here is my <code>setup.py</code>:</p>
  
  <pre><code>from distutils.core import setup
  
  if __name__ == "__main__":
      setup(
          name='myPackage',
          package_dir = {
              'mySubPackage1': 'mySubPackage1',
              'mySubPackage2': 'mySubPackage2'},
          packages=['mySubPackage1', 'mySubPackage2'],
      )
  </code></pre>
  
  <p>The problem is that, when I run <code>python setup.py install</code> from <code>myPackage</code>, the <em>sub</em> packages are installed into <code>dist-packages</code>:</p>
  
  <pre><code>/usr/local/lib/python2.7/dist-packages/mySubPackage1
  /usr/local/lib/python2.7/dist-packages/mySubPackage2
  </code></pre>
  
  <p>I guess the problem is my <code>setup.py</code>, but I don't know how to fix it? Should it be in the parent directory of <code>myPackage</code>? If so, then how does it work when I pack the package into a <code>zip</code> using <code>python setup.py sdist</code>?</p>