changing LD_LIBRARY_PATH for Python script

Mail Archiving Daemon bboard at
Tue Mar 28 22:21:52 CEST 2000

Hi.  I'm in a situation where I need to set the LD_LIBRARY_PATH before
loading a Python module.  But I can't find a way of doing this from
Python.  By the time I'm actually in the Python script, the
interpreter is running, and changing the value of os.environ has no
effect on that process (or on the dl mechanism).  I could use a trick
like Martin's

if true :
	exec python "$0" "$@"

del true, then, fi

If I could only figure out the right strings to put in there :-).

The code that is affected is a shared library loaded from *another*
shared library that is in turn loaded from Python as a Python module.


More information about the Python-list mailing list