Installing setuptools with no network connection
31 Mar 2006…and I mean really no network or internet connection!
The setuptools instructions do suggest that you can do this using ez_setup.py 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 "ez_setup.py", line 228, in ?
main(sys.argv[1:])
File "ez_setup.py", line 161, in main
egg = download_setuptools(version, to_dir=tmpdir, delay=0)
File "ez_setup.py", line 142, in download_setuptools
src = urllib2.urlopen(url)
File "c:\python24\lib\urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "c:\python24\lib\urllib2.py", line 358, in open
response = self._open(req, data)
File "c:\python24\lib\urllib2.py", line 376, in _open
'_open', req)
File "c:\python24\lib\urllib2.py", line 337, in _call_chain
result = func(*args)
File "c:\python24\lib\urllib2.py", line 1021, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "c:\python24\lib\urllib2.py", 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 ez_setup.py setuptools.egg that it would work.
Hope this helps someone else!`