RE: [Distutils] Installation directory
From: Bastian Kleineidam [mailto:calvin@cs.uni-sb.de]
it is installed directly into the C:\Applications\Python20 directory, which is the Python installation directory. This is not what I would want, especially as the default action.
There was a somewhat lengthy discussion about installation dirs at the beginning of the year, including some mighty words from Guido. You can follow the discussion on the archives, here is a wrapup: http://www.python.org/pipermail/distutils-sig/20 00-February/001181.html I think in most cases it boils down to installing things in sys.prefix and sys.exec_prefix.
OK. So the current behaviour is by design. That's fair enough - I don't personally like it, but that isn't a good reason for it to change.
Nothing prevents you from using your custom install scheme though (with --install-lib and such).
Agreed. I guess that is what I should do. Two questions spring to mind: 1. Is it possible for me to specify a default --install-lib value which will be used in all installs unless overridden (effectively a site preferences file for distutils)? If not, is it feasible to add such a thing? 2. What happens with binary distributions? (I've not tried building one of these yet, so it may be obvious...) Can I install a binary distribution and specify --install-lib, or is the bdist_wininst version unable to accept command line overrides? Actually, a third (Python) question: If I do add a "site library" directory, what do I need to do to get Python to recognise it by default? Looking at the documentation of the site module, it looks like Unix has a site-python directory already, via sys.prefix, whereas Windows doesn't. Should/could I just set sys.prefix somehow? (Maybe this should be directed to somewhere like the Python newsgroup, though). Paul
Hi Paul,
1. Is it possible for me to specify a default --install-lib value which will be used in all installs unless overridden (effectively a site preferences file for distutils)? If not, is it feasible to add such a thing? Config files are supported since May 2000, but not yet documented. Here is the archive mail: http://www.python.org/pipermail/distutils-sig/2000-May/001482.html
2. What happens with binary distributions? (I've not tried building one of these yet, so it may be obvious...) Can I install a binary distribution and specify --install-lib, or is the bdist_wininst version unable to accept command line overrides? No custom schemes for .exe binary distributions.
Actually, a third (Python) question: If I do add a "site library" directory, what do I need to do to get Python to recognise it by default? Looking at the documentation of the site module, it looks like Unix has a site-python directory already, via sys.prefix, whereas Windows doesn't. Should/could I just set sys.prefix somehow? (Maybe this should be directed to somewhere like the Python newsgroup, though). You can set the environment variable PYTHONPATH to give additional directories to search for python modules.
Bastian
Actually, a third (Python) question: If I do add a "site library"
directory,
what do I need to do to get Python to recognise it by default? Looking at the documentation of the site module, it looks like Unix has a site-python directory already, via sys.prefix, whereas Windows doesn't. Should/could I just set sys.prefix somehow? (Maybe this should be directed to somewhere like the Python newsgroup, though).
You can set the environment variable PYTHONPATH to give additional directories to search for python modules.
Or add it to the registry in HKLM\Software\Python\PythonCore\2.0\PythonPath, or make a file named sitecustomize.py in your Python root directory that imports sys and inserts or appends to sys.path directly. -- Robin Dunn Software Craftsman robin@AllDunn.com http://wxPython.org Java give you jitters? http://wxPROs.com Relax with wxPython!
On 24 October 2000, Moore, Paul said:
Agreed. I guess that is what I should do. Two questions spring to mind: 1. Is it possible for me to specify a default --install-lib value which will be used in all installs unless overridden (effectively a site preferences file for distutils)? If not, is it feasible to add such a thing?
Create distutils.cfg in the Distutils package dir -- typically C:\Python\Lib\distutils on Windows. Contents: [install] install-lib=C:\Python\SiteLib for whatever value of "C:\Python\SiteLib" you prefer. For the record, this *is* documented now. Should be in Fred's latest doc snapshot, which I think is on SourceForge. Then make sure that this is always added to Python's search path. There's more than one way to do it (oops! did I say that on a *Python* list? ;-), but the easiest and most straightforward is a .pth file. Eg. create "site.pth" in C:\Python, containing exactly one line: "SiteLib". (This should work because "SiteLib" is relative to "C:\Python".) Completely untested, off-the-cuff, no idea if it'll work on Windows, use at your own risk, etc. etc. Greg -- Greg Ward - programmer-at-big gward@python.net http://starship.python.net/~gward/ I have the power to HALT PRODUCTION on all TEENAGE SEX COMEDIES!!
participants (4)
-
Bastian Kleineidam
-
Greg Ward
-
Moore, Paul
-
Robin Dunn