title: In Python's imp, "ImportError: No frozen submodule named ..."
body: <p>I'm trying to write a script which searches a directory for a module with a given name. I'd like to use the <code>find_module</code> method of Python's <a href="https://docs.python.org/2/library/imp.html" rel="nofollow noreferrer">imp</a>. However, I don't quite understand why the following doesn't work. I'm in a directory which contains a module <code>iclib</code>:</p>
  
  <pre><code>kurt@kurt-ThinkPad:~/dev/ipercron-compose/furion$ tree
  .
  ├── iclib
  │   ├── __init__.py
  </code></pre>
  
  <p>In that directory I can (in iPython) import <code>iclib</code>:</p>
  
  <pre><code>In [1]: import iclib
  </code></pre>
  
  <p>I can also use <code>find_module</code> without a <code>path</code> argument:</p>
  
  <pre><code>In [1]: import imp
  
  In [2]: imp.find_module('iclib')
  Out[2]: (None, 'iclib', ('', '', 5))
  </code></pre>
  
  <p>However, if I try to use <code>find_module</code> in the current directory only, I get an error:</p>
  
  <pre><code>In [3]: import os
  
  In [4]: imp.find_module('iclib', os.getcwd())
  ---------------------------------------------------------------------------
  ImportError                               Traceback (most recent call last)
  &lt;ipython-input-4-ada6f3744e78&gt; in &lt;module&gt;()
  ----&gt; 1 imp.find_module('iclib', os.getcwd())
  
  ImportError: No frozen submodule named /home/kurt/dev/ipercron-compose/furion.iclib
  </code></pre>
  
  <p>Why doesn't this work?</p>