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.
I've tried all of these. os.environ['LD_LIBRARY_PATH'] = "./lib" os.putenv('LD_LIBRARY_PATH', "./lib") os.system("export LD_LIBRARY_PATH=./lib") lib = CDLL("libevaluator.so") Traceback (most recent call last): File "Evaluator.py", line 9, in <module> lib = CDLL("libevaluator.so") File "/usr/lib/python2.5/ctypes/__init__.py", line 348, in __init__ self._handle = _dlopen(self._name, mode) OSError: libevaluator.so: cannot open shared object file: No such file or directory 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?
-- http://mail.python.org/mailman/listinfo/python-list