title: Using absolute_import and handling relative module name conflicts in python
body: <p>I really hope this is a simple case of me miss-understanding the complex Python2 import mechanisms. I have the following setup:</p>
  
  <pre><code>$&gt; ls -ltr pypackage1 
  total 3
  -rw-r--r-- 1 pelson pelson   0 Aug 17 19:20 io.py
  -rw-r--r-- 1 pelson pelson   0 Aug 17 19:20 __init__.py
  -rw-r--r-- 1 pelson pelson  57 Aug 17 19:22 code.py
  $&gt; cat pypackage1/code.py 
  from __future__ import absolute_import
  
  import zipfile
  </code></pre>
  
  <p>i.e. I have nothing but a stub package with an empty <code>__init__.py</code> and <code>io.py</code>, and a 2 lines <code>code.py</code> file.</p>
  
  <p>I can import <code>pypackage1</code>:</p>
  
  <pre><code>$&gt; python -c "import pypackage1.code"
  </code></pre>
  
  <p>But I cannot run the <code>code.py</code> file:</p>
  
  <pre><code>$&gt; python pypackage1/code.py
  Traceback (most recent call last):
    File "pypackage1/code.py", line 3, in &lt;module&gt;
      import zipfile
    File "python2.7/zipfile.py", line 462, in &lt;module&gt;
      class ZipExtFile(io.BufferedIOBase):
  AttributeError: 'module' object has no attribute 'BufferedIOBase'
  </code></pre>
  
  <p>Clearly the problem has to do with the <code>zipfile</code> module picking up my relative io module over the builtin <code>io</code> module, but I thought my <code>from __future__ import absolute_import</code> would have fixed that.</p>
  
  <p>Thanks in advance for any help,</p>