Distributing python application
<p>I am writing a quite large Python application; the application is actually to a large part a wrapping of several shared libraries written in C and C++(Qt). I am 'installing' this without administrator rights, so everything including shared libraries, binary and also Python modules must be in non-standard locations, i.e. I have a situation like this:  </p>

<ol>
  <li> Shared libraries in /funny/path/lib </li>
  <li> Python modules installed in /funny/path/python/lin </li>
  <li> The python interpreter itself might also be in /nonstandard/location </li>
</ol>

<p>The whole thing is distributed as open source, and I need to find a reasonably elegant and simple way to set the necessary environment variables. The whole thing is distributed with version control software; so the environment variables must be set in some 'local addition' i.e. something like:  </p>

<pre><code>#!/bin/bash
export LD_LIBRARY_PATH /funny/path/lib:$LD_LIBRARY_PATH
export PYTHONPATH /funn/path/python/lib:$PYTHONPATH

# 
exec python main.py
</code></pre>

<p>But I am programming in Python for a reason - I detest these shell scripts. Any views on the most elegant way to do this would be nice.</p>

<p>Joakim</p>
