|
Original |
Translation |
|
67
|
|
|
|
68
|
Often, it is necessary or desirable to install modules to a location other than the standard location for third-party Python modules. For example, on a Unix system you might not have permission to write to the standard third-party module directory. Or you might wish to try out a module before making it a standard part of your local Python installation. This is especially true when upgrading a distribution already present: you want to make sure your existing base of scripts still works with the new version before actually upgrading.
|
|
|
69
|
The Distutils :command:`install` command is designed to make installing module distributions to an alternate location simple and painless. The basic idea is that you supply a base directory for the installation, and the :command:`install` command picks a set of directories (called an *installation scheme*) under this base directory in which to install files. The details differ across platforms, so read whichever of the following sections applies to you.
|
|
|
70
|
Alternate installation: the home scheme
|
|
|
71
|
|
72
|
Installing a new module distribution is as simple as ::
|
|
|
73
|
python setup.py install --home=<dir>
|
|
|
74
|
where you can supply any directory you like for the :option:`--home` option. On Unix, lazy typists can just type a tilde (``~``); the :command:`install` command will expand this to your home directory::
|
|
|
75
|
python setup.py install --home=~
|
|
|
76
|
The :option:`--home` option defines the installation base directory. Files are installed to the following directories under the installation base as follows:
|
|