I've learned elsewhere on Stack Exchange that Apple has removed the formerly preferred way to set environment variables, /etc/launchd.conf
, from OS X Yosemite. The Apple rep I linked to and others advise creating a launch agent to set the environment variables. My problem is that I run a number of Python scripts from launchd and I need to set the PYTHONPATH
environment variable for them. The launch agent approach lets me set PYTHONPATH
for most of what I run, but the change does not seem to percolate into jobs that are run straight from launchd. I have a lot of these jobs, so I don't want to have to set the environment variable I need in the launch agent for each. Is there a way I can make the environment variable change deeply enough that even stuff run from launchd itself picks up the change?
My current workaround is to use a .pth
file but that only works for Python.