I have a problem on OSX that #!/usr/bin/env python3
is causing the environment variables, such as library paths (LD_LIBRARY_PATH for example), to be lost. On Linux it works correctly.
Reading the man page on env
it doesn't appear it should be doing this. It should only be modifying the environment if I request it, and I am not.
What is a portable shebang line that preserves the environment?
Note: I'm detecting the problem since a call to subprocess.open
on one of my programs fails since it can't find one of the libraries. Yet if I start python interactively the same call works fine.