Python 2.6 and Tox

Just ran into an issue running tox in diskimage-builder on a CentOS 6.5 instance I booted to test a change that failed the python26 gate test, so I thought I'd post the fix in case anyone else hits the same thing.

First, I installed pip via the instructions on the site. Unfortunately I skimmed over the end of that section because I already had setuptools installed. Bad idea, as it turned out.

Then I installed tox via pip install "tox<1.7" (I think tox 1.7 is still broken with OpenStack, although I didn't actually try it).

When I ran tox -e py26 in the diskimage-builder git repo, I got the following traceback for my efforts:
[cloud-user@centos diskimage-builder]$ tox -e py26
Traceback (most recent call last):
File "/usr/bin/tox", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/", line 2655, in
File "/usr/lib/python2.6/site-packages/", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: virtualenv>=1.9.1

The problem seems to be that the setuptools installed by default in CentOS 6.5 is very old, so a pip install -U setuptools fixed the problem and tox ran fine.