[Pythonmac-SIG] fixing the PATH environment variable for 2.3
Kevin Altis
altis@semi-retired.com
Sun, 2 Feb 2003 17:02:57 -0800
To simplify using the "right" Python (aka 2.3a1 not Apple's 2.2), I added
/usr/local/bin back to the PATH environment variable, by adding PATH to my
~/.MacOSX/environment.plist file.
<key>PATH</key>
<string>/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin</string>
If you like having your home directory as part of the PATH, you could use:
<key>PATH</key>
<string>/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/Users/username</string
>
substitute your own username for "username" in the string above. See the
following link for setting up your ~/.MacOSX/environment.plist file if you
haven't already got one.
http://www.astro.washington.edu/owen/AquaEnvVar.html
I also created a simple .cshrc, since environment.plist doesn't seem to be
getting picked up in the Terminal. The ~/.cshrc file just contains:
setenv PATH /usr/local/bin:$PATH
If you are using the bash shell you should create something similar for your
.bashrc.
Now you can just type python or pythonw in the Terminal and get the "right"
Python. Scripts launched with PythonLauncher will also have the right PATH
environment variable because of the environment.plist setting.
I'm tempted to have a script that can automatically create these files for
users if they don't already have them; those that have them should know
enough to munge them if needed. Creating these files as a default part of
the MachoPython install seems a bit much, but until Apple is distributing
2.3 (maybe this fall?), developers are probably going to want to modify
their PATH.
Other suggestions?
ka