|
Original |
Translation |
|
127
|
[install] install-base=$HOME install-purelib=python/lib install-platlib=python/lib.$PLAT install-scripts=python/scripts install-data=python/data
|
|
|
128
|
[install] install-base=$HOME/python install-purelib=lib install-platlib=lib.$PLAT install-scripts=scripts install-data=data
|
|
|
129
|
Note that these two are *not* equivalent if you supply a different installation base directory when you run the setup script. For example, ::
|
|
|
130
|
python setup.py install --install-base=/tmp
|
|
|
131
|
|
132
|
You probably noticed the use of ``$HOME`` and ``$PLAT`` in the sample configuration file input. These are Distutils configuration variables, which bear a strong resemblance to environment variables. In fact, you can use environment variables in config files on platforms that have such a notion but the Distutils additionally define a few extra variables that may not be in your environment, such as ``$PLAT``. (And of course, on systems that don't have environment variables, such as Mac OS 9, the configuration variables supplied by the Distutils are the only ones you can use.) See section :ref:`inst-config-files` for details.
|
|
|
133
|
Modifying Python's Search Path
|
|
|
134
|
When the Python interpreter executes an :keyword:`import` statement, it searches for both Python code and extension modules along a search path. A default value for the path is configured into the Python binary when the interpreter is built. You can determine the path by importing the :mod:`sys` module and printing the value of ``sys.path``. ::
|
|
|
135
|
$ python Python 2.2 (#11, Oct 3 2002, 13:31:27) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', '/usr/local/lib/python2.3/site-packages'] >>>
|
|
|
136
|
The null string in ``sys.path`` represents the current working directory.
|
|