[Distutils] pip install --upgrade bug on python3.x

Paul Moore p.f.moore at gmail.com
Thu Jan 10 14:35:58 CET 2013

On 10 January 2013 11:29, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Paul Moore <p.f.moore <at> gmail.com> writes:
>> The problem is that distribute supports Python 2.4 and up. Until they
>> drop support for at least 2.4 and 2.5, they don't stand a chance of
>> moving away from 2to3 to a single-source model (and even then, it's a
>> lot of work for little benefit so they may not want to take that step
>> anyway). It's the 2to3 process that's the issue here.
> Actually, when I was working on the venv stuff, the time it took to install
> distribute in a venv was annoyingly high because of 2to3 (and because I was doing
> a lot of this while testing). So I created a fork of distribute called
> distribute3, at
> https://bitbucket.org/vinay.sajip/distribute3
> which works on Python 2.x and 3.x from a single code base. I hadn't looked at
> testing it with 2.4, but I did just now, and after a couple of tweaks all the
> tests pass bar one which tries to write into a system site-packages location
> (the same failure on 2.4 and 2.5, no failures on 2.6 and later - probably a
> distutils issue which got fixed).

Nice :-) I took a different approach, for much the same reason, and
wrote a patch to virtualenv (which has been applied) to install
distribute from prebuilt eggs rather than source. That solved the
problem for virtualenv, which was my issue, but this is a much better

> I didn't bother suggesting to upstream about merging my changes, since it's a
> critical piece of infrastructure and "all tests pass" only means so much. But
> a single code base, even supporting 2.4, seems achievable.

I'd suggest offering it to upstream - let them review it and take a
view. I agree it's not something to do lightly, though. But it does
seem to address a number of issues:
- The one in this thread
- An issue I had where building via 2to3 caused failures related to
not being able to delete temp directories (I never quite understood
the problem, likely to be antivirus software interference, but
installing from an egg resolved it)
- The slowness of installs using 2to3


More information about the Distutils-SIG mailing list