title: Import error on installed package using setup.py
body: <p>I have a problem with using <code>setup.py</code> to setup a python package. First, I have the following directory setup:</p>
  
  <pre><code>maindir
     |- setup.py
     |-mymodule
           |- __init__.py
           |- mainmodule.py
           |-subdir
               |- __init__.py
               |- submodule.py
  </code></pre>
  
  <p>i.e. the project directory contains the <code>setup.py</code> and a directory <code>mymodule</code>, which in itself contains two python modules in two directories. 
  The file <code>submodule.py</code> contains just</p>
  
  <pre><code>teststring = "hello world"
  </code></pre>
  
  <p><code>mainmodule.py</code> contains:</p>
  
  <pre><code>from .subdir import submodule
  mainstring = "42"
  </code></pre>
  
  <p>and <code>setup.py</code> contains:</p>
  
  <pre><code>import os
  from setuptools import setup
  setup(
      name = "mytestmodule",
      version = "0.0.1",
      description = ("A simple module."),
      packages=['mymodule'],
  )
  </code></pre>
  
  <p>When I do <code>from mymodule import mainmodule</code> with <code>ipython</code> from within <code>sourceTest</code> the behaviour works as expected and I can reference e.g. <code>mainmodule.submodule.teststring</code> which gives me the string <code>hello world</code>. </p>
  
  <p>On the other side, when I install this 'package' using <code>python setup.py install</code> and try to do the same (from within some other directory), I get an import error:</p>
  
  <pre><code>In [1]: from mymodule import mainmodule
  ---------------------------------------------------------------------------
  ImportError                               Traceback (most recent call last)
  /home/alexander/&lt;ipython-input-1-cf4c9bafa487&gt; in &lt;module&gt;()
  ----&gt; 1 from mymodule import mainmodule
  
  /home/alexander/build/bdist.linux-i686/egg/mymodule/mainmodule.py in &lt;module&gt;()
  
  ImportError: No module named subdir
  </code></pre>
  
  <p>I do not see what I have done wrong, as I followed a <a href="http://pythonhosted.org/an_example_pypi_project/setuptools.html">Getting started tutorial</a> and <a href="http://docs.python.org/2/tutorial/modules.html#packages-in-multiple-directories">rules for importing intra-packages</a>. I suppose my mistake is a really tiny one, but I cannot spot it and help is appreciated. </p>