title: Setting LD_LIBRARY_PATH from inside Python
body: <p>Is there a way to set specify <em>during runtime</em> where Python looks for shared libraries?</p>
  
  <p>I have <code>fontforge.so</code> located in <code>fontforge_bin</code> and tried the following</p>
  
  <pre><code>os.environ['LD_LIBRARY_PATH']='fontforge_bin'
  sys.path.append('fontforge_bin')
  import fontforge
  </code></pre>
  
  <p>and get</p>
  
  <pre><code>ImportError: fontforge_bin/fontforge.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>Doing <code>ldd</code> on <code>fontforge_bin/fontforge.so</code> gives the following</p>
  
  <pre><code>linux-vdso.so.1 =&gt;  (0x00007fff2050c000)
  libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x00007f10ffdef000)
  libc.so.6 =&gt; /lib/libc.so.6 (0x00007f10ffa6c000)
  /lib64/ld-linux-x86-64.so.2 (0x00007f110022d000)
  </code></pre>