if setuptools.__version__ == '0.0.1':
"You have an obsolete version of setuptools installed. Please\n"
"remove it from your system entirely before rerunning this script."
# XXX could we install in a subprocess here?
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
" a more recent version first."
as an egg for download under the `download_base` URL (which should end
with a '/'). `to_dir` is the directory where the egg will be downloaded.
+ from urllib2 import urlopen
egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
url = download_base + egg_name + '.zip' # XXX
saveto = os.path.join(to_dir, egg_name)
from distutils import log
log.warn("Downloading %s", url)
- src =
# Read/write all in one block, so we don't create a corrupt file
# if the download is interrupted.
from setuptools.command.easy_install import main
- print "Setuptools version",version,"or greater has been installed."
- print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
+ print("Setuptools version",version,"or greater has been installed.")
+ print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)')