[Distutils] easy_install and Unix python with sys.prefix different from sys.exec_prefix

Berthold Höllmann berthold at despammed.com
Thu Nov 16 16:01:43 CET 2006

"Phillip J. Eby" <pje at telecommunity.com> writes:

> At 02:57 PM 11/15/2006 +0100, Berthold Höllmann wrote:
>>After being away from this stuff for a while I want to it. Is there a
>>technical reason for not honoring the difference between "--prefix"
>>and "--exec-prefix" in setuptools the way python and distutils do?
>>With distutils an extensions will be installed into the "exec prefix"
>>path and a module into the "prefix" path. For our purpose I moved the
>>extensions extensions out of the "prefix" site-packages directory into
>>the "exec-prefix" site-packages directory, removed the according lines
>>from the easy-install.pth in the "prefix" tree and copied them to a
>>hand written easy-install.pth in the "exec-prefix" trees. The
>>installation seems to work.
> When using setuptools, there is no reason to use separate prefix and 
> exec-prefix for library installation, because platform-specific libraries 
> include the platform in their .egg name, so your copying and moving is a 
> waste of time.
> Just try this (making appropriate substitutions, of course):
>      easy_install -mxd prefix/lib/site-packages ...
>      easy_install -d exec_prefix/lib/site-packages -s exec_prefix/bin ...
> And repeat both lines for each platform-specific implementation you need, 
> running the appropriate easy_install for the platform.
> These commands will first install eggs to the $prefix without a .pth or 
> scripts (the -m prevents the .pth, the -x prevents the scripts), and then 
> it will create platform-specific .pth and script files in $exec_prefix.
> There should be no need for you to manually fudge anything, assuming that 
> both your prefix and exec-prefix's site-packages are on sys.path.  Give it 
> a try.

I'll certainly give it a try, but why so much hassle for the person
installing, when the required information is easily avaliable for the
easy_install tool? Hey I read "easy_install" ;-)

This still does not solve the problem with the "#!" or shebang lines
in scripts. Especially when installing modules, I think using the full
path to the python executable is wrong. I'm still pleading for a way
to customize the string after the "#!" part.

Thank You
                            __   Address:
                         G /  \ L Germanischer Lloyd
phone: +49-40-36149-7374 -+----+- Vorsetzen 35       P.O.Box 111606
fax  : +49-40-36149-7320   \__/   D-20459 Hamburg    D-20416 Hamburg

More information about the Distutils-SIG mailing list