Installing setuptools with no network connection

…and I mean really no network or internet connection!

The setuptools instructions do suggest that you can do this using and passing it the .egg file for setuptools. However, I found that doing this got me a stacktrace for my efforts:


Traceback (most recent call last):
  File "", line 228, in ?
  File "", line 161, in main
    egg = download_setuptools(version, to_dir=tmpdir, delay=0)
  File "", line 142, in download_setuptools
    src = urllib2.urlopen(url)
  File "c:\python24\lib\", line 130, in urlopen
    return, data)
  File "c:\python24\lib\", line 358, in open
    response = self._open(req, data)
  File "c:\python24\lib\", line 376, in _open
    '_open', req)
  File "c:\python24\lib\", line 337, in _call_chain
    result = func(*args)
  File "c:\python24\lib\", line 1021, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "c:\python24\lib\", line 996, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (11001, 'getaddrinfo failed')>

I eventually found that if I changed the egg to a zip file, extracted its contents, renamed back to an egg and then ran setuptools.egg that it would work.

Hope this helps someone else!`