Trouble importing shared object in Python
<p>I am attempting to import a shared object into my python code, like so:</p>

<pre><code>import bz2
</code></pre>

<p>to which I get the following error:</p>

<blockquote>
  <p>ImportError: ./bz2.so: cannot open shared object file: No such file or
  directory</p>
</blockquote>

<p>Using the imp module, I can verify that Python can actually find it:</p>

<pre><code>&gt;&gt;&gt; import imp
&gt;&gt;&gt; imp.find_module('bz2')
(&lt;open file 'bz2.so', mode 'rb' at 0xb6f085f8&gt;, 'bz2.so', ('.so', 'rb', 3))
</code></pre>

<p>The shared object file is in my PYTHONPATH and my LD_LIBRARY_PATH.</p>

<p>Any insights into why I can't import this shared object? Thanks!</p>