title: How to import a module in Python with importlib.import_module
body: <p>I'm trying to use <a href="https://docs.python.org/2/library/importlib.html" rel="noreferrer"><code>importlib.import_module</code></a> in Python 2.7.2 and run into the strange error.</p>
  
  <p>Consider the following dir structure:</p>
  
  <pre>
      a
      |
      + - __init__.py
        - b
          |
          + - __init__.py
            - c.py
  </pre>
  
  <p><code>a/b/__init__.py</code> has the following code:</p>
  
  <pre>
      import importlib
  
      mod = importlib.import_module("c")
  </pre>
  
  <p>(In real code <code>"c"</code>has a name.) </p>
  
  <p>Trying to <code>import a.b</code>, yields the following error:</p>
  
  <pre>
      >>> import a.b
      Traceback (most recent call last):
        File "", line 1, in 
        File "a/b/__init__.py", line 3, in 
          mod = importlib.import_module("c")
        File "/opt/Python-2.7.2/lib/python2.7/importlib/__init__.py", line 37, in   import_module
          __import__(name)
      ImportError: No module named c
  </pre>
  
  <p>What am I missing?</p>
  
  <p>Thanks!</p>