[Distutils] easy_install and Unix python with sys.prefix different from sys.exec_prefix
Phillip J. Eby
pje at telecommunity.com
Wed Nov 15 17:54:41 CET 2006
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
More information about the Distutils-SIG