166
166
--- ./Lib/distutils/sysconfig.py.orig 2009-03-27 19:47:42.000000000 +0100
167
167
+++ ./Lib/distutils/sysconfig.py 2009-04-02 16:52:41.000000000 +0200
169
169
If 'prefix' is supplied, use it instead of sys.prefix or
170
170
sys.exec_prefix -- i.e., ignore 'plat_specific'.
172
+ # work around an automake expansion bug
173
+ if prefix and prefix in ('${prefix}', '${exec_prefix}') and not 'real_prefix' in sys.__dict__:
174
+ prefix = '/usr/local'
175
172
+ is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local')
176
173
if prefix is None:
177
174
prefix = plat_specific and EXEC_PREFIX or PREFIX
186
183
return os.path.join(libpython, "site-packages")
185
--- Doc/install/index.rst~ 2009-01-04 13:57:46.000000000 +0100
186
+++ Doc/install/index.rst 2009-04-10 15:50:58.000000000 +0200
188
+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
189
| Platform | Standard installation location | Default value | Notes |
190
+=================+=====================================================+==================================================+=======+
191
+| Debian/Ubuntu | :file:`{prefix}/lib/python{X.Y}/dist-packages` | :file:`/usr/local/lib/python{X.Y}/dist-packages` | \(0) |
192
++-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
193
| Unix (pure) | :file:`{prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1) |
194
+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
195
| Unix (non-pure) | :file:`{exec-prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1) |
201
+ Starting with Python-2.6 Debian/Ubuntu uses for the Python which comes within
202
+ the Linux distribution a non-default name for the installation directory. This
203
+ is to avoid overwriting of the python modules which come with the distribution,
204
+ which unfortunately is the upstream behaviour of the installation tools. The
205
+ non-default name in :file:`/usr/local` is used not to overwrite a local python
206
+ installation (defaulting to :file:`/usr/local`).
209
Most Linux distributions include Python as a standard part of the system, so
210
:file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` on
213
/usr/bin/python setup.py install --prefix=/usr/local
215
+Starting with Python-2.6 Debian/Ubuntu does use
216
+:file:`/usr/lib/python{X.Y}/dist-packages` and
217
+:file:`/usr/local/lib/python{X.Y}/dist-packages` for the installation
218
+of python modules included in the Linux distribution. To overwrite
219
+the name of the site directory, explicitely use the :option:`--prefix`
220
+option, however make sure that the installation path is included in
221
+``sys.path``. For packaging of python modules for Debian/Ubuntu, use
222
+the new ``setup.py install`` option :option:`--install-layout=deb`.
224
Another possibility is a network filesystem where the name used to write to a
225
remote directory is different from the name used to read it: for example, the
226
Python interpreter accessed as :file:`/usr/local/bin/python` might search for
228
import them, this directory must be added to ``sys.path``. There are several
229
different ways to add the directory.
231
+On Debian/Ubuntu, starting with Python-2.6 the convention for system
232
+installed packages is to put then in the
233
+:file:`/usr/lib/python{X.Y}/dist-packages/` directory, and for locally
234
+installed packages is to put them in the
235
+:file:`/usr/lib/python{X.Y}/dist-packages/` directory. To share the
236
+locally installed packages for the system provided Python with the
237
+locally installed packages of a local python installation, make
238
+:file:`/usr/lib/python{X.Y}/dist-packages/` a symbolic link to the
239
+:file:`{...}/site-packages/` directory of your local python
242
The most convenient way is to add a path configuration file to a directory
243
that's already on Python's path, usually to the :file:`.../site-packages/`
244
directory. Path configuration files have an extension of :file:`.pth`, and each