Almost happy ubuntu 12.04.1 user here.
I installed python and virtualenv with
sudo apt-get install python-dev python-virtualenv
and am using the commands
$ PIP_CACHE=$HOME/pip_cache
$ virtualenv --no-site-packages sandbox
$ cd sandbox
$ . bin/activate
$ pip install --no-install --use-mirrors -I --download=$PIP_CACHE
-emaster
to install buildbot from source while saving downloaded packages.
Then, on an isolated host, after copying ~/pip_cache, I run
$ PIP_CACHE=$HOME/pip_cache
$ virtualenv --no-site-packages sandbox
$ cd sandbox
$ . bin/activate
$ pip install --find-links=file://$PIP_CACHE --no-index
--index-url=file:///dev/null -emaster
in an attempt to get rid of the need for an internet connection.
( As recommended in the second answer in
http://stackoverflow.com/questions/4806448/how-do-i-install-from-a-lo...
and alluded to in http://carljm.github.com/tamingdeps
and http://www.pip-installer.org/en/latest/usage.html#install-packages )
This does fill the cache directory with some tarballs:
$ ls $PIP_CACHE
buildbot-0.8.8-pre-121-g0ea11a4.zip distribute-0.6.28.tar.gz
python-dateutil-1.5.tar.gz sqlalchemy-migrate-0.7.2.tar.gz
Twisted-12.2.0.tar.bz2
decorator-3.3.3.tar.gz Jinja2-2.6.tar.gz
SQLAlchemy-0.7.8.tar.gz Tempita-0.5.1.tar.gz
zope.interface-4.0.1.tar.gz
but sadly, installing on the isolated system fails with
Running setup.py egg_info for package from
file:///home/buildbot/master-state/sandbox/buildbot-git/master
Download error on http://pypi.python.org/simple/setuptools_trial/:
[Errno 101] Network is unreachable -- Some packages may not be found!
Download error on http://pypi.python.org/simple/setuptools-trial/:
[Errno 101] Network is unreachable -- Some packages may not be found!
Couldn't find index page for 'setuptools_trial' (maybe misspelled?)
Download error on http://pypi.python.org/simple/: [Errno 101] Network
is unreachable -- Some packages may not be found!
No local packages or download links found for setuptools-trial
Traceback (most recent call last):
File "<string>", line 14, in <module>
File
"/home/buildbot/master-state/sandbox/buildbot-git/master/setup.py", line
216, in <module>
setup(**setup_args)
File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/setuptools/dist.py",
line 221, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/setuptools/dist.py",
line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/pkg_resources.py",
line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/pkg_resources.py",
line 821, in best_match
return self.obtain(req, installer) # try and download/install
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/pkg_resources.py",
line 833, in obtain
return installer(requirement)
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/setuptools/dist.py",
line 294, in fetch_build_egg
return cmd.easy_install(req)
File
"/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/dist ribute-0.6.24-py2.7.egg/setuptools/command/easy_install.py",
line 583, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution
for Requirement.parse('setuptools-trial')
I see from
https://groups.google.com/forum/?fromgroups=#!topic/python-virtualenv...
http://lists.debian.org/debian-release/2010/08/msg01621.html
and
http://packages.ubuntu.com/precise/all/python-virtualenv/filelist
that the directory /usr/share/python-virtualenv is where setuptools
comes from. Should there be a setuptools_trial egg there, too?
Or should setuptools_trial somehow be in my $PIP_CACHE?
I'll gladly take a workaround like "just pre-install setuptools_trial like
this".
(This is made harder to debug by my visceral hatred of complex systems that
make it hard to achieve repeatable builds, and of rabbithole ecosystems in
general. I'm trying to keep an open mind, but it's hard when you're a
curmudgeon.)
Thanks,
Dan