[issue18320] python installation is broken if prefix is overridden on an install target

Ned Deily report at bugs.python.org
Thu Jul 17 02:35:04 CEST 2014


Ned Deily added the comment:

The problem you see is being caused by trying to override "prefix" on the "altinstall" or "install" targets.  While Makefiles for many products will let you do that successfully, you really can't do that with Python's.  Unfortunately, the values for "prefix" and "exec_prefix" specified (or defaulted) on ./configure are used during the main make build targets.  This includes the customization of the shebangs lines for the scripts like "idle" and "pydoc".  If you change the "prefix" value for the "install" phase, most files do get installed at the changed location but there are various places where the original, configured values remain.  You can see this if you run "python -m sysconfig" and examine the prefix values.  One result is that any scripts installed via Distutils (including using pip) will get installed to the configured location, e.g. default /usr/local/bin.  This also affects ensurepip (new in 3.4): the pip and easy_install scripts are installed in the configured value of prefix, e.g. /usr/local/bin, rather than the overridden value.  That's not good.

Changing prefix on the install targets seems like a fairly esoteric use case and one with an easy workaround: don't do that, use ./configure --prefix=/path/to instead.  I don't think it's worth trying to support since it may require some major Makefile work to get all the right dependencies.  But, at a minimum, it would be worth adding a test to the various install targets that would check and abort if prefix is attempted to be changed so you don't end up with a silently broken installation.

----------
components: +Build
keywords: +easy
nosy: +ned.deily
stage:  -> needs patch
title: idle, pydoc search python on wrong path at make altinstall with different exec- and prefix e.g. $HOME -> python installation is broken if prefix is overridden on an install target

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18320>
_______________________________________


More information about the Python-bugs-list mailing list