title: Relative import in urllib3
body: <p>I'm studying how python loads modules.</p>
  
  <p>I'm starting from <code>requests</code> that loads <code>urllib3</code>.</p>
  
  <p>I have found <a href="https://github.com/urllib3/urllib3/blob/cd7cfa613b2678e700597d098ce9bbdc934863e6/src/urllib3/exceptions.py#L2-L4" rel="nofollow noreferrer">those line</a>:</p>
  
  <pre><code>from .packages.six.moves.http_client import (
    IncompleteRead as httplib_IncompleteRead
  )
  </code></pre>
  
  <p>in file called <code>src/urllib3/exceptions.py</code></p>
  
  <p>That import is a relative one, so I'm looking for the folder <code>src/urllib3/packages/six/moves/http_client.py</code> or <code>src/urllib3/packages/six/moves/http_client/__init__.py</code></p>
  
  <p>Those files don't exist.</p>
  
  <p>Thankfully <code>src/urllib3/packages/six.py</code> defines a new module loader, so the import <code>.packages.six.moves.http_client</code> requires <code>http_client</code> core python module instead.</p>
  
  <p>But I don't understand how the <code>src/urllib3/packages/six.py</code> is loaded.
  I've not found that kind of import.</p>
  
  <p>Is there a way to know which module loads <code>src/urllib3/packages/six.py</code> directly?</p>
  
  <p>I have tried with <code>__name__</code> global variable as suggested <a href="https://stackoverflow.com/questions/5286210/is-there-a-way-to-access-parent-modules-in-python/45895490">here</a>. Its value is <code>urllib3.packages.six</code> but <code>urllib3.packages</code> doesn't load that file.</p>