I was hoping I could update LD_LIBRARY_PATH at runtime and load a library through ctypes from there, but I haven't been able to.<br><br>I've tried all of these.<br><br>os.environ['LD_LIBRARY_PATH'] = "./lib"<br>
os.putenv('LD_LIBRARY_PATH', "./lib")<br>os.system("export LD_LIBRARY_PATH=./lib")<br>lib = CDLL("libevaluator.so")<br><br>Traceback (most recent call last):<br>  File "Evaluator.py", line 9, in <module><br>
    lib = CDLL("libevaluator.so")<br>  File "/usr/lib/python2.5/ctypes/__init__.py", line 348, in __init__<br>    self._handle = _dlopen(self._name, mode)<br>OSError: libevaluator.so: cannot open shared object file: No such file or directory<br>
<br>The only thing that works is to set the variable before starting Python. I'm assuming that's just how it's going to be. Is this a bug or is it meant to be?<br><br>