title: 'Attempted relative import in non-package' although packages with __init__.py in one directory
body: <p>I have a module named <code>extended.py</code> which contains the following line:</p>
  
  <pre><code>from .basic import BasicModule
  </code></pre>
  
  <p>and the file <code>basic.py</code> resides in the same directory as does <code>__init__.py</code>. However, when I try to run it as: </p>
  
  <pre><code>python extended.py
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>ValueError: Attempted relative import in non-package
  </code></pre>
  
  <p>Also adding the line:</p>
  
  <pre><code>from __future__ import absolute_import
  </code></pre>
  
  <p>does not solve the problem. 
  Maybe I am too tired to see the obvious - but I don't see the problem here.</p>