Finding .so files without setting LD_LIBRARY_PATH

dieter dieter at handshake.de
Thu May 12 03:08:35 EDT 2016


Paul Smith <paul at mad-scientist.net> writes:
> ...
> That works fine, but here's the problem: because LD_LIBRARY_PATH is in
> Python's environment it is also passed down to programs invoked by
> Python.  That means if I (for example) invoke subprocess.call(['ssh',
> ...]) then it fails because the system ssh is looking for the system
> libcrypto.so, and when it finds the Python libcrypto.so instead
> (because of LD_LIBRARY_PATH) it fails.

I have had a similar problem - however with "PYTHONPATH" instead
of "LD_LIBRARY_PATH". I solved it by removing "PYTHONPATH" from
"os.environ" during Python startup. This way, the envvar
"PYTHONPATH" was effective to set up "sys.path" but
processes started from this python would not see it.




More information about the Python-list mailing list