title: Python import failure
body: <p>Got some strange import error which is as much strangely reported by interpreter.</p>
  
  <p>I use CPython-3.5</p>
  
  <p>Directory structure:</p>
  
  <pre><code>.
  +-- outer
  |   +-- inner
  |   |   +-- __init__.py
  |   |   +-- first.py
  |   |   +-- second.py
  |   +-- __init__.py
  +-- main.py
  </code></pre>
  
  <p>main.py:</p>
  
  <pre><code>import outer.inner
  print(outer.inner.var)
  </code></pre>
  
  <p>outer/__init__.py: empty</p>
  
  <p>outer/inner/__init__.py:</p>
  
  <pre><code>import outer.inner.first
  var = outer.inner.first.var
  </code></pre>
  
  <p>outer/inner/first.py:</p>
  
  <pre><code>import outer.inner.second
  var = outer.inner.second.var
  </code></pre>
  
  <p>outer/inner/second.py:</p>
  
  <pre><code>var = 1337
  </code></pre>
  
  <p>then, I run <code>main.py</code> and script fails with this stack trace:</p>
  
  <pre><code>Traceback (most recent call last):
    File "main.py", line 1, in &lt;module&gt;
      import outer.inner
    File "/outer/inner/__init__.py", line 1, in &lt;module&gt;
      import outer.inner.first
    File "/outer/inner/first.py", line 2, in &lt;module&gt;
      var = outer.inner.second.var
  AttributeError: module 'outer' has no attribute 'inner'
  </code></pre>
  
  <p>So, Python does not want to bind names correctly. Although import statement in first.py: <code>import outer.inner.second</code> is executed without crashing, this statement binds to name <code>outer</code> something like an empty package, which doesn't have (but should) the module named <code>inner</code> </p>
  
  <p>What do I do wrong?</p>