title: Weird issues with imports in python package
body: <p>I'm building an installable python package, it's basically a CLI based on <code>docopt</code> and other herbs.</p>
  
  <p>The overall structure is as follows:</p>
  
  <pre><code>README.md
  MANIFEST.in
  setup.py
  grok/
     __init__.py
     module.py
     other_module.py
     main.py
  </code></pre>
  
  <p>On my <code>main.py</code> I have the other modules imported as follows:</p>
  
  <p>main.py</p>
  
  <pre class="lang-py prettyprint-override"><code># Imagine the docopt USAGE string here
  from .module import something
  from .other_module import other_something
  
  # the rest of the logic comes here
  
  
  </code></pre>
  
  <p>The main issue is, I can install the package and use it, but, when I'm changing the code, maybe adding features or fixing a bug, if I try to run it like this:</p>
  
  <pre><code>python main.py -h 
  </code></pre>
  
  <p>It gives me the following error:</p>
  
  <pre><code>ModuleNotFoundError: No module named '__main__.module'; '__main__' is not a package
  </code></pre>
  
  <p>I googles a bit and found out that because of the <code>dot</code> on my imports I'm actually referencing <code>__main__</code>, so, I should remove the <code>dots</code> and I should be able to test it the way I intended after that.</p>
  
  <p>I did so, and it worked, I tested all my stuff, and then ran the test suite, as a part of the suite it tests installing the package and run it with <code>-h</code> as a way to smoke-test it, and it failed with the following error:</p>
  
  <pre><code>ModuleNotFoundError: No module named 'module'
  </code></pre>
  
  <p>Then I re-added the <code>dots</code> to the imports and the test passed.</p>
  
  <p>What am I doing wrong? in theory I should be able to import everything in a way I can execute the installed package and run it on my code for testing without having to change anything.</p>
  
  <p>Any hints?</p>