[Distutils] [issue100] setuptools and easy-install.pth

Dennis setuptools at bugs.python.org
Wed Dec 30 12:41:33 CET 2009


New submission from Dennis <dennisveatch at bellsouth.net>:

Caveat: I am not wise in the ways of Pythonology and may misunderstand the use
of easy-install.pth, so please bear with me.

What started this off was an attempt to install the latest calibre. It
complained it could not find lxml (even though it was installed). So I
recompiled lxml (just to be sure) then calibre; it then complained it could not
find mechanize. So I reinstalled mechanize (it was already installed) and then
calibre complains it cannot find lxml; rinse and repeat. In the end I just
manually added the eggs needed by calibre to easy-install.pth and it compiled
fine. Then just to see what happens I recompiled setuptools and it blew away
everything I had added to easy-install.pth leaving just the setuptools egg.

So I started looking at setuptools and installing from source is straight forward;

python setup.py build && python setup.py install

and end up with;

/usr/lib/python2.6/site-packages/easy-install.pth
/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
/usr/lib/python2.6/site-packages/setuptools.pth

and easy-install.pth contains;

import sys; sys.__plen = len(sys.path)
./setuptools-0.6c11-py2.6.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:];
p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

Now if I install lxml, easy-install.pth contains;

import sys; sys.__plen = len(sys.path)
./lxml-2.2.4-py2.6-linux-x86_64.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:];
p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

What happened to ./setuptools-0.6c11-py2.6.egg? So I recompile setuptools and
now easy-install.pth has removed the lxml egg and I end up where I started. So
setuptools over writes easy-install.pth instead of adding itself. This happens
with a number of other python apps that use setuptools/easy-install.pth.

In the docs I saw a mention of running setuptools-0.6c11-py2.6.egg as a script.
Had no problems doing that, except its behavior is the same as the other build
process.

At this point I am a little confused about whether easy-install.pth should be
appended by setuptools or actually over written. If it is the latter, it seems
counter-intuitive.

----------
messages: 483
nosy: dveatch
priority: bug
status: unread
title: setuptools and easy-install.pth

_______________________________________________
Setuptools tracker <setuptools at bugs.python.org>
<http://bugs.python.org/setuptools/issue100>
_______________________________________________


More information about the Distutils-SIG mailing list