[Distutils] Buildout not updating setuptools
Jim Fulton
jim at zope.com
Sun Jul 8 13:17:51 CEST 2007
Oh system Pythons.
I can only reproduce this using the ubuntu python-setuptools
package. Installing setuptools myself using ez_setup doesn't give
this behavior.
The Unbuntu python-setuptools package installation is rather odd. It
doesn't install setuptools as a normal egg. Rather it installs it in
such a way that it shows up as a develop egg.
jim at starbase14:~/tmp$ python
Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import pkg_resources
>>> pkg_resources.working_set.find(pkg_resources.Requirement.parse
('setuptools'))
setuptools 0.6c5 (/usr/lib/python2.5/site-packages)
Note that the location of the setuptools egg is site packages.
>>> d = pkg_resources.working_set.find
(pkg_resources.Requirement.parse('setuptools'))
>>> d.precedence == pkg_resources.DEVELOP_DIST
True
So, the Ubuntu packager for setuptools decided not to install
setuptools as an actual egg, but as a wonky sort-of develop egg with
a less than ideal location.
IMO, this is just wrong and broken. Does anyone disagree? I could
probably add logic to the bootstrap script to get around this, but
I'm not very motivated to do so. I'm inclined to say that if you
choose to use this version of setuptools, by using your system Python
and a system package of setuptools, then you'll have to live with its
limitations.
Of course, your system easy_install won't install routs either:
jim at starbase14:~/tmp$ sudo easy_install routes
Password:
Searching for routes
Reading http://cheeseshop.python.org/pypi/routes/
Couldn't find index page for 'routes' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://cheeseshop.python.org/pypi/
Reading http://cheeseshop.python.org/pypi/Routes/1.7
Reading http://routes.groovie.org/
Best match: Routes 1.7
Downloading http://cheeseshop.python.org/packages/source/R/Routes/
Routes- 1.7.tar.gz#md5=6b8892b8aef7495228376f4e8b6c747b
Processing Routes-1.7.tar.gz
Running Routes-1.7/setup.py -q bdist_egg --dist-dir /tmp/
easy_install-goT506/Routes-1.7/egg-dist-tmp-fT_EqK
The required version of setuptools (>=0.6c6) is not available, and
can't be installed while this script is running. Please install
a more recent version first.
(Currently using setuptools 0.6c5 (/usr/lib/python2.5/site-packages))
error: Setup script exited with 2
The good news is that setuptools can repair itself:
sudo easy_install -U setuptools
Doing this causes setuptools to upgrade itself to a regular egg-based
install. At this point (at least on my system), I can install routes
and, when I run buildout, it doesn't create an egg link in the develo-
eggs directory. Of course, at that point, you've probably messed up
your system packaging
I will probably do something about this in the long run though just
to avoid the question coming up.
Jim
On Jul 7, 2007, at 2:07 PM, Graham Stratton wrote:
> Hi Jim, thanks for your time.
>
>>> and nor does running bin/buildout. The
>>> result is that the Routes install fails with
>>> The required version of setuptools (>=0.6c6) is not available, ...
>>
>> I tried to reproduce this, but was unable to.
>
> Here's what I did on a clean ubuntu server from the VMWare appliance
> site:
>
> #Install the system setuptools (0.6c5):
> $ sudo apt-get install subversion python-setuptools
> $ svn co svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/ .
>
> $ vi buildout.cfg
> *****
> [buildout]
> parts = foxtrot
>
> [foxtrot]
> recipe = zc.recipe.egg
> interpreter = python2.5
> eggs = routes
> ******
>
> $ python2.5 bootstrap.py
>
> $ ls develop-eggs/
> setuptools.egg-link
> $ cat develop-eggs/setuptools.egg-link
> /usr/lib/python2.5/site-packages
> $ ls eggs/
> zc.buildout-1.0.0b28-py2.5.egg
>
> $./bin/buildout -v
> Installing 'zc.buildout', 'setuptools'.
> We have the best distribution that satisfies 'zc.buildout'.
> Picked: zc.buildout = 1.0.0b28
> We have a develop egg: setuptools 0.6c5
> Installing 'zc.recipe.egg'.
> We have the best distribution that satisfies 'zc.recipe.egg'.
> Picked: zc.recipe.egg = 1.0.0b6
> Uninstalling foxtrot.
> Installing foxtrot.
> Installing 'routes'.
> We have no distributions for routes that satisfies 'routes'.
> Couldn't find index page for 'routes' (maybe misspelled?)
> Getting distribution for 'routes'.
> We have a develop egg: setuptools 0.6c5
> Running easy_install:
> /usr/bin/python2.5 "-c" "from setuptools.command.easy_install import
> main; main()" "-mUNxd" "/home/notroot/eggs/tmp_IqDV_" "-q" "/tmp/
> tmpDtCTlqget_dist/Routes-1.7.tar.gz"
> path=/usr/lib/python2.5/site-packages
>
> The required version of setuptools (>=0.6c6) is not available, and
> can't be installed while this script is running. Please install
> a more recent version first.
>
> (Currently using setuptools 0.6c5 (/usr/lib/python2.5/site-packages))
> error: Setup script exited with 2
> An error occured when trying to install Routes 1.7.Look above this
> message for any errors thatwere output by easy_install.
> While:
> Installing foxtrot.
> Getting distribution for 'routes'.
> Error: Couldn't install: Routes 1.7
>
>
>
> I hope that's useful output/input,
>
> Graham
> _______________________________________________
> Distutils-SIG maillist - Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Distutils-SIG
mailing list