title: Installing python module rtree with a user scheme: location of DLL
body: <p>I am installing the python module <code>rtree</code> on a cluster for which I do not have root access.</p>
  
  <p>I have installed the required library <code>libspatialindex</code> into <code>~/var/lib</code> prior to the installation of the actual python package, but when I run <code>pip install --user rtree</code> I get the error:</p>
  
  <pre><code>OSError: libspatialindex_c.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I have tried to add <code>~/var/lib</code> to the path on my .bashrc file, but this did not help. The error is triggered by the line </p>
  
  <pre><code>rt = ctypes.CDLL(lib_name)
  </code></pre>
  
  <p>that is the command which should load the DLL.</p>
  
  <p>Is there any way of specifying this path so that the installation script can see it?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I just found the solution to this: it is not <code>PATH</code>, but <code>LD_LIBRARY_PATH</code> which contains information about the location of DLLs.</p>
  
  <p>Adding the line</p>
  
  <pre><code>export LD_LIBRARY_PATH=~/usr/lib:$LD_LIBRARY_PATH
  </code></pre>
  
  <p>to my <code>.bashrc</code> did the trick.</p>