new to mac OS10

Maurice LING mauriceling at acm.org
Sat Apr 16 21:59:45 EDT 2005


Hi Thomas,

It seems that you've cleanly killed the Apple-installed Python, which 
isn't too bad a thing after all. What I can suggest you do is this... 
Copy the entire /System/Library/Frameworks/Python.framework directory 
from someone and drop it into your system (same place of course). I will 
not suggest installing Python 2.4.1 until the Apple-installed Python is 
sorted out. My reasons being,

1. I have no idea what Mac OSX uses Python for. Although symlink may get 
you through most of the time but I cannot be sure that none of OSX's 
stuffs are hardcoded to use the Python in 
/System/Library/Frameworks/Python.framework.

2. Installing another Python may or may not be a precise remedy. It may 
just worsen things and I won't want to bet on that.

3. Apple-installed Python's command line tools are symlinked from 
/usr/bin to /System/Library/Frameworks/Python.framework but the OSX 
installer for Python 2.4.1 places the commandline tools in 
/usr/local/bin and symlinked to /Library/Frameworks/Python.framework. So 
it seems to me that Python 2.4.1 (installed using OSX installer for 
Python 2.4.1) is not a precise replacement of Apple-installed Python...

For me, my setup is this

ls -all /usr/bin/python*
lrwxr-xr-x  1 root  wheel   14  4 Apr 08:40 /usr/bin/python -> 
/sw/bin/python
lrwxr-xr-x  1 root  wheel   72  1 Apr  1976 /usr/bin/python2.3 -> 
../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
lrwxr-xr-x  1 root  wheel   10  1 Apr  1976 /usr/bin/pythonw -> pythonw2.3
-rwxr-xr-x  1 root  wheel  122  9 Jun  2003 /usr/bin/pythonw2.3

/usr/bin/pythonw2.3 and /usr/bin/python2.3 points to the same thing, 
/System/Library/Frameworks/Python.framework/Versions/2.3/bin/python. And 
I have Fink's Python in /sw/bin/python.

So now, for me, if I need to use the Apple-installed Python, my command 
line is "pythonw" while "python" gives me Fink's Python as shown below:

~ mauriceling$ pythonw
Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys
 >>> sys.path
['', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', 
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages']
 >>>


~ mauriceling$ python
Python 2.3.5 (#1, Apr  6 2005, 13:01:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1671)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys
 >>> sys.path
['', '/sw/lib/python23.zip', '/sw/lib/python2.3', 
'/sw/lib/python2.3/plat-darwin', '/sw/lib/python2.3/plat-mac', 
'/sw/lib/python2.3/plat-mac/lib-scriptpackages', 
'/sw/lib/python2.3/lib-tk', '/sw/lib/python2.3/lib-dynload', 
'/sw/lib/python2.3/site-packages', 
'/sw/lib/python2.3/site-packages/Numeric', 
'/sw/lib/python2.3/site-packages/libsbml', 
'/sw/lib/python2.3/site-packages/gtk-2.0']
 >>>

There is no problem with having multiple versions and copies of Pythons 
in your system. The problems are:

1. get all the symlinks correct
2. know when to use what and how to use
3. means that you may have to install the same 3rd party library x-times 
for x-numbers of Pythons you might have... quite a pain...

Cheers
Maurice





More information about the Python-list mailing list