title: how to make python load dylib on osx
body: <p>Trying to load a shared lib out of the current '.' dir in a unit test on osx.</p>
  
  <p>What works on Linux and Netbsd there is a symlink <code>_mymodule.so --&gt; ../.libs/libmymodule.so</code></p>
  
  <p>but on osx, python's <code>import mymodule</code> won't find</p>
  
  <pre><code>_mymodule.dylib --&gt; ../.libs/libmymodule.dylib
  </code></pre>
  
  <p>I've tried adding</p>
  
  <pre><code>export DYLD_LIBRARY_PATH=.:$DYLD_LIBRARY_PATH
  </code></pre>
  
  <p>to the script env, nogo.  Any help appreciated.</p>
  
  <p>-Ed</p>
  
  <p>update 4/6/10:</p>
  
  <p>Solved with the info from krunk below.  But just copying or ln -s'ing the dylib to a .so name didn't solve it completely.  Still wouldn't load.  But telling libtool to link the lib with the -module flag created a .so lib that would load.  Python version of the lib works now.</p>
  
  <p>Now if I could just get the perl lib working.  I'm building swig perl, python, ruby, and lua libs and this fix only got python and lua working.</p>