title: Python Relative Import Shared C++ Library
body: <p>Say I have a folder structure like this:</p>
  
  <pre><code>run.py
  lib
  |-- __init__.py
  |-- pkg1
  |  |-- __init__.py
  |  |-- mod1.so
  |-- pkg2
  |  |-- __init__.py
  |  |-- mod2.py
  </code></pre>
  
  <p>Where <code>mod1.so</code> is a C++ shared library. In <code>mod2.py</code> I have a relative import statement <code>from ..pgk1 import mod1</code>, and in <code>run.py</code> I have <code>import lib.pkg2.mod2</code> If I run <code>python run.py</code> I get the following error:</p>
  
  <pre><code>ImportError: ./lib/pkg1/mod1.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>Any ideas why the improt won't work?</p>