Yosemite
/etc/launchd.conf
is no longer supported in 10.10. See man launchctl
:
The /etc/launchd.conf file is no longer consulted for subcommands to run during early boot time; this functionality was removed for security considerations.
You can now for example save this plist as ~/Library/LaunchAgents/my.startup.plist
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>launchctl setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
The launchctl setenv
command is ran as the user, so it only applies to processes launched in the user domain.
This method doesn't apply to applications that are reopened at login if "Reopen windows when logging back in" is checked.
Mavericks and earlier
In 10.9 and earlier, you can for example run
echo setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin|sudo tee -a /etc/launchd.conf
and then restart to apply the changes.
Other methods
/etc/paths
and /etc/paths.d/
apply only (or mainly) to shells. The lines in /etc/paths
and /etc/paths.d/*
are added to the path by path_helper, which is run from /etc/profile
, /etc/zshenv
, and /etc/csh.login
. I don't know any programs other than shells that would consider /etc/paths
or /etc/paths.d/
.
~/.MacOSX/environment.plist
stopped working in 10.8.
You can yourself ensure that this file isn't anymore used with a command as simple as ls
.
Just end your actual session, and connect back.
Open Terminal
or xterm
.
Run the following command:
$ cd ~/.MacOSX
$ ls -luT environment.plist
$
The output of this command will display you when this file was last opened for reading.
If it was opened by any process during your session start, you should
see it thanks to the u
option.
To learn more about the investigation possibilities of ls
just run:
$ man ls
BTW, your environment.plist
file doesn't use the right syntax.
But this doesn't matter.
Best Answer
Check your current PYTHONPATH setting by opening /Applications/Utilities/Terminal.app and typing the following command and hit the return key:
Try this alternate syntax in Terminal.app to see if it sets your PYTHONPATH correctly. Recheck the result with the above command again. If so, put the line in your ~/.bash_profile (although a file in /etc/paths.d/ with just the PATH, no commands, ought to set this system-wide).