title: python installing package with submodules
body: <p>I have a custom project package with structure like:</p>
  
  <pre><code> package-dir/
       mypackage/
           __init__.py
           submodule1/
                __init__.py
                testmodule.py
           main.py
       requirements.txt
       setup.py
  </code></pre>
  
  <p>using <code>cd package-dir</code> followed by <code>$pip install -e .</code> or <code>pip install .</code> as suggested by <a href="http://python-packaging.readthedocs.io/en/latest/minimal.html?highlight=pip%20install" rel="noreferrer">python-packaging</a> as long as I access the package from <code>package-dir</code></p>
  
  <p>For example :</p>
  
  <pre><code> $cd project-dir
   $pip install .
  </code></pre>
  
  <p>at this point this works:</p>
  
  <pre><code> $python -c 'import mypackage; import submodule1'
  </code></pre>
  
  <p>but This does not work</p>
  
  <pre><code> $ cd some-other-dir
   $ python -c 'import mypackage; import submodule1'
   Traceback (most recent call last):
   File "&lt;stdin&gt;", line 1, in &lt;module&gt;
   ImportError: No module named submodule1
  </code></pre>
  
  <p>How to install all the submodules?</p>
  
  <p>also, if i check the <code>package-dir/build/lib.linux-x86_64-2.7/mypackage</code> dir, I only see the immediate files in <code>mypackage/*.py</code> and NO <code>mypackage/submodule1</code></p>
  
  <p><code>setup.py</code> looks like:</p>
  
  <pre><code>from setuptools import setup
  from pip.req import parse_requirements
  
  reqs = parse_requirements('./requirements.txt', session=False)
  install_requires = [str(ir.req) for ir in reqs]
  
  
  def readme():
      with open('README.rst') as f:
          return f.read()
  
  setup(name='mypackage',
        version='1.6.1',
        description='mypackage',
        long_description=readme(),
        classifiers=[
  
        ],
        keywords='',
        url='',
        author='',
        author_email='',
        license='Proprietary',
        packages=['mypackage'],
        package_dir={'mypackage': 'mypackage'},
        install_requires=install_requires,
        include_package_data=True,
        zip_safe=False,
        test_suite='nose.collector',
        tests_require=['nose'],
        entry_points={
            'console_scripts': ['mypackage=mypackage.run:run'],
        }
        )
  </code></pre>