Finding .so files without setting LD_LIBRARY_PATH

Lawrence D’Oliveiro lawrencedo99 at
Thu Jun 2 01:57:47 EDT 2016

On Thursday, May 12, 2016 at 9:51:02 AM UTC+12, Paul Smith wrote:
> ... 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['ssh',
> ...]) then it fails because the system ssh is looking for the system
>, and when it finds the Python instead
> (because of LD_LIBRARY_PATH) it fails.

That’s easy enough to fix: you can pass a custom environment down to subprocesses by using the “env” argument to the various subprocess calls <>.

More information about the Python-list mailing list