easy_install will install a package that is already there

Bug #601040 reported by Barry Warsaw
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-setuptools
Unknown
Unknown
python-setuptools (Ubuntu)
Confirmed
High
Barry Warsaw
Nominated for Lucid by Barry Warsaw
Nominated for Maverick by Barry Warsaw

Bug Description

Binary package hint: python-setuptools

Upstream bug report:

http://bitbucket.org/tarek/distribute/issue/142/easy_install-will-install-a-package-that-is-already

This causes compatibility problems between distribute and setuptools, and shows up when using virtualenv, which uses distribute by default (as does our python-setuptools package). From distutils-sig, here's a reproducible test case for Lucid:

Sure. Create a dummy setup.py:

from setuptools import setup
setup(name="foo", install_requires=["somepkg"])

with "somepkg" any package already installed on ubuntu, and then:

virtualenv tmp
source tmp/bin/activate
python setup.py install

You will see that somepkg is downloaded and installed even though it
is already there. It happened for me for any value of somepkg,
including twisted, django, simplejson.

As for using setuptools instead of distribute in virtualenv, I cannot
see the option on my current machine (with lucid virtualenv), which is
weird because I clearly remember having seen it at work. I will check
there to see what's different,

Tags: lucid
Barry Warsaw (barry)
Changed in python-setuptools (Ubuntu):
importance: Undecided → High
assignee: nobody → Barry Warsaw (barry)
milestone: none → ubuntu-10.04.1
Revision history for this message
Tarek Ziadé (tziade) wrote :

Works for me on the current Lucid:

$ sudo easy_install extensions
Searching for extensions
...
Processing dependencies for extensions
Finished processing dependencies for extensions

$ virtualenv /tmp/test
...
$ cd /tmp/test
$ more setup.py
from setuptools import setup
setup(name='mindeponpywin32', install_requires=['extensions'])

$ sudo bin/python setup.py install
...
Using /usr/local/lib/python2.6/dist-packages/extensions-0.4-py2.6.egg
...

Revision history for this message
Tarek Ziadé (tziade) wrote :

I could finally reproduce it.

David backport from setuptools here will fix the issue : http://bitbucket.org/tarek/distribute/changeset/b045d0750c13

I've also added a test here: http://bitbucket.org/tarek/distribute/changeset/aa5216d69ae7

I will do a 0.6.14 release once you've succesfully tried the patch on your side.

Last, if there's anything else I could merge from upstream in 0.6.14, let me know.

Revision history for this message
Barry Warsaw (barry) wrote :

Hmm. Tarek, I built a version of python-distribute in my PPA with the above referenced patch, and installed it on a Maverick system. Then I went through the recipe in the OP and it still downloaded simplejson even though that's already installed. Is this still a valid test? I'll have to investigate it in more detail tomorrow.

Revision history for this message
Barry Warsaw (barry) wrote :

Tarek, I cannot confirm that the patch solves the download problem when a package is already installed. Of course, it's possible I did not apply the patch correctly or that I'm doing something wrong. I think if you feel the patch works, then I'll defer to you. Go ahead and release the new version and we'll get that into Debian and Ubuntu.

Revision history for this message
Tarek Ziadé (tziade) wrote :

Hey Barry,

I could reproduce it with this recipe from the distribute bug report

$ sudo apt-get install python-virtualenv python-twisted <-- you get twisted installed (try "import twisted")
$ virtualenv /tmp/xxx
$ cd /tmp/xxx
$ easy_install twisted # downloads twisted, it shouldn't

If I install manually virtualenv 1.4.9 instead of using ubuntu virtualenv (1.4.5), and I make sure to install setuptools instead of distribute, then it works as expected (i.e. creating a virtualenv and easy_installing twisted just register from the ubuntu twisted, nothing is downloaded).

Once the patch is applied, it should not be the case anymore.

I'd be more confident if you can reproduce the issue on your side before we do the releases

Cheers

Revision history for this message
Barry Warsaw (barry) wrote :

Hi Tarek, here's what I've tested.

Running virtualenv 1.4.5 with --setuptools (i.e. not running distribute), after 'apt-get install simplejson', easy_install simplejson will not download the package from Cheeseshop. With --distribute, it will download simplejson.

I built a package of 1.4.9 from Debian testing and installed it on a Maverick system. After setting up a virtualenv with --setuptools, easy_install simplejson will still not download it from Cheeseshop when it's been installed via apt-get. However, even with virtualenv 1.4.9, when called with --distribute, it will download simplejson from Cheeseshop. I can't tell where there's any difference in behavior between virtualenv 1.4.5 and 1.4.9 when run with --setuptools or --distribute.

So I'm not sure whether this bug is actually fixed in 1.4.9 or not. Therefore I'm going to move this to milestone 10.04.2, and I await your feedback.

Changed in python-setuptools (Ubuntu):
milestone: ubuntu-10.04.1 → ubuntu-10.04.2
status: New → Confirmed
Revision history for this message
Barry Warsaw (barry) wrote :

From IRC:

<tarek> the bug is in distribute
<tarek> barry, I've released 0.6.14
<barry> tarek, ok. so i need to update distribute; will that work with virtualenv 1.4.5?
<tarek> barry, virtualenv include its own distribute version so you need to double check this
<barry> tarek, hmm, okay. i will update the bug report, but i don't think i will get to this for ubuntu 10.04.1. i've milestoned it to 10.04.2
<tarek> barry, depending on how it was packaged, it might update its distribute version or not

papukaija (papukaija)
tags: added: lucid
Revision history for this message
papukaija (papukaija) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 254035, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.