tags:

views:

45

answers:

1

I've been wondering why python gets installed in directory named Frameworks? (though it's not Framework)

$ which python                                                                                    
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

Somebody please explain! Thanks!

+4  A: 

That's the way it is in OS X.

The Mac/README file in the Python source tree goes into some more details of the advantages of a framework build versus a traditional UNIX shared-library build, which will also work on OS X. The main points:

  • "The main reason is because you want to create GUI programs in Python. With the exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run from a fullblown MacOSX application (a ".app" bundle).

    While it is technically possible to create a .app without using frameworks you will have to do the work yourself if you really want this.

    A second reason for using frameworks is that they put Python-related items in only two places: "/Library/Framework/Python.framework" and "/Applications/MacPython 2.6". This simplifies matters for users installing Python from a binary distribution if they want to get rid of it again. Moreover, due to the way frameworks work a user without admin privileges can install a binary distribution in his or her home directory without recompilation."

Ned Deily
README.txt: `The installer puts the applications in "Python 2.7" in your Applications folder, command-line tools in/usr/local/bin and the underlying machinery in/Library/Frameworks/Python.framework.`
heapzero
The second point isn't really true though. For instance the site-packages directory is under /Library/Python/2.6.
Daniel Roseman
`/Library/Python/` is the default site-packages location for the Apple-supplied Pythons shipped with OS X, not with the python.org installed Pythons nor ones built from source. Those use `/Library/Frameworks ...`.
Ned Deily