[Distutils] installing distutils

Greg Ward gward@cnri.reston.va.us
Tue, 1 Feb 2000 09:21:38 -0500

On 31 January 2000, Curtis Jensen said:
> View the USAGE file.  Near the end it tells how.  It'll be a command
> similar to:  
> setup.py -v install --prefix=/home/greg --exec-prefix=/home/greg
> If /home/greg was where you wanted to install to.

Some caveats here:

  * installing to non-standard directories doesn't work very well in
    general; it was poorly thought out and needs to be redesigned for
    the next version
  * so, don't curse too hard trying to get it to work -- it's my fault,
    not yours!
  * if you use the --prefix/--exec-prefix options, be aware that the
    standard Python library structure will be mimicked, e.g. in the
    above example modules will be installed to
  * if you want finer control, you should use the --install-site-lib or
    --install-site-platlib options (example forthcoming).
  * when using either --prefix/exec-prefix (or --install-site-lib/
    install-site-platlib), be aware of which one to supply: only *one*
    of them is used to install any given Python module distribution.  If
    any extension modules are present, only --exec-prefix (or
    --install-site-platlib) need be supplied; if the distribution is
    100% pure Python, only --prefix (or --install-site-lib) need be
    supplied.  Requiring users to know this is a bug.
  * when installing non-packagized distributions that are supposed to go
    in their own directory under site-packages, Distutils ignores this
    request when installing to a non-standard directory.  (I think.  It
    probably depends on whether you use --prefix/exec-prefix or
    --install-sitelib/install-site-platlib.)  This is a bug.

Here's the recommended way to install Numeric Python to a non-standard
directory *using Distutils 0.1.x*:

   python setup.py install --install-site-platlib=$HOME/lib/python/Numeric

where you can supply whatever base you like instead of $HOME/lib/python;
but putting it into a directory called Numeric is strongly recommended,
because that's what Distutils would do if you were installing to the
standard library directory.  Finally, you have to make sure that the
exact directory named -- $HOME/lib/python/Numeric -- is in your

Please don't count on this buggy, counterintuitive behaviour existing
beyond Distutils 0.1.x...