[Distutils] Trouble installing Myghty with --prefix

Phillip J. Eby pje at telecommunity.com
Wed Nov 30 19:43:01 CET 2005


At 11:58 AM 11/30/2005 -0600, skip at pobox.com wrote:

>     Ian> There's non-root installation instructions on the setuptools site
>     Ian> (and maybe included in easy_install now?) that will create a full
>     Ian> Python environment in a non-standard location, which would probably
>     Ian> resolve this issue.
>
>Thanks, but that's not what I'm after.  On my CentOS 4 server, Python 2.3.x
>is installed with /usr as the prefix (that is, I use the CentOS-provided
>version of Python).  I install all third-party packages (including my own
>code) with a prefix of /usr/local/mojam so I can a) avoid polluting the base
>package and b) install things without becoming root.  Accordingly, I dump a
>mojam.pth file in the system site-packages directory which contains this one
>line:
>
>     /usr/local/mojam/lib/python2.3/site-packages
>
>That is my only pollution of the default Python installation.  I'd like to
>keep it that way.  Can setuptools (be made to) do the job?

Yes, but you need two things:

1.  Change your .pth file to read:

     import site; 
site.addsitedir('/usr/local/mojam/lib/python2.3/site-packages')

2. Create a distutils.cfg in /usr/lib/python2.3/distutils/ with the 
contents I mentioned before.

Basically, without #1, .pth files in 
/usr/local/mojam/lib/python2.3/site-package won't be processed by Python, 
and without #2, setuptools won't know that Python is processing the .pth files.



More information about the Distutils-SIG mailing list