[Python-Dev] Added platform-specific directories to sys.path
Guido van Rossum
guido@python.org
Fri, 19 Jul 2002 17:23:07 -0400
> I've a question that I'd like some feedback on. On MacOSX
> there's a set of directories that are meant especially for
> storing extensions to applications, and there's requests on the
> pythonmac-sig that I add these directories to the Python search
> path. This could easily be done optionally, with a .pth file in
> site-python.
>
> MacOSX has rationalized where preferences, libraries, licenses,
> extensions, etc are stored, and for all of these there's a
> hierarchy of folders. In the case of Python extension modules
> the logical places would be ~/Library/Application Support/Python
> (for user-installed extension modules), /Library/Application
> Support/Python (for machine-wide installed extension modules)
> and /Network/Library/Application Support/Python (for
> workgroup-wide installed modules). The final location, in
> /System, is for factory-installed stuff from Apple, not needed
> just yet for this example:-).
>
> I sympathize with the idea of making things more conform to the
> platform standard, on the other hand I'm a bit reluctant to do
> things differently again from what other Pythons do. But, one of
> the things that is sorely missing from Python is a standard
> place to install per-user extension modules, so this might well
> be the thing that triggers inclusion of such functionality into
> the grand scheme of things (including distutils support, etc).
Traditionally, on Unix per-user extensions are done by pointing
PYTHONPATH to your per-user directory (-ies) in your .profile.
On Windows you can do this too, but I bet most people just have a
per-user computer. :-)
--Guido van Rossum (home page: http://www.python.org/~guido/)