Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Run pip without internet connection

Received: by 10.50.76.194 with SMTP id m2mr721803igw.2.1347593505052;
        Thu, 13 Sep 2012 20:31:45 -0700 (PDT)
X-BeenThere: python-virtualenv@googlegroups.com
Received: by 10.50.51.234 with SMTP id n10ls9827138igo.3.canary; Thu, 13 Sep
 2012 20:31:44 -0700 (PDT)
Received: by 10.42.69.8 with SMTP id z8mr571440ici.30.1347593504453;
        Thu, 13 Sep 2012 20:31:44 -0700 (PDT)
Received: by 10.50.82.36 with SMTP id f4msigy;
        Thu, 13 Sep 2012 17:51:41 -0700 (PDT)
Received: by 10.68.197.70 with SMTP id is6mr431828pbc.14.1347583901069;
        Thu, 13 Sep 2012 17:51:41 -0700 (PDT)
Date: Thu, 13 Sep 2012 17:51:40 -0700 (PDT)
From: Dan Kegel <daniel.r.ke...@gmail.com>
To: python-virtualenv@googlegroups.com
Message-Id: <63a28d7c-10fa-4a54-8cf6-718439483b92@googlegroups.com>
Subject: Run pip without internet connection
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1740_28691948.1347583900441"

------=_Part_1740_28691948.1347583900441
Content-Type: multipart/alternative; 
	boundary="----=_Part_1741_14829826.1347583900441"

------=_Part_1741_14829826.1347583900441
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

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-local-cache-with-pip
 
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/distribute-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/distribute-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/distribute-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/distribute-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/distribute-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/distribute-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/distribute-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/K05_oEBiRPw
 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


------=_Part_1741_14829826.1347583900441
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<div>Almost happy ubuntu 12.04.1 user here.</div><div><br></div><div>I inst=
alled python and virtualenv with</div><div>&nbsp; sudo apt-get install pyth=
on-dev python-virtualenv<br></div><div>and am using the commands</div><div>=
&nbsp; &nbsp; $ PIP_CACHE=3D$HOME/pip_cache</div><div>&nbsp; &nbsp; $&nbsp;=
virtualenv --no-site-packages sandbox</div><div>&nbsp; &nbsp; $ cd sandbox<=
/div><div>&nbsp; &nbsp; $ . bin/activate</div><div><div>&nbsp; &nbsp; $ pip=
 install --no-install --use-mirrors -I --download=3D$PIP_CACHE -emaster<br>=
</div><div>to install buildbot from source while saving downloaded packages=
.</div><div>Then, on an isolated host, after copying ~/pip_cache, I run</di=
v><div>&nbsp; &nbsp; $ PIP_CACHE=3D$HOME/pip_cache</div><div>&nbsp; &nbsp; =
$&nbsp;virtualenv --no-site-packages sandbox</div><div>&nbsp; &nbsp; $ cd s=
andbox</div><div>&nbsp; &nbsp; $ . bin/activate</div><div></div><div>&nbsp;=
 &nbsp; $ pip install --find-links=3Dfile://$PIP_CACHE --no-index --index-u=
rl=3Dfile:///dev/null -emaster<br></div></div><div>in an attempt to get rid=
 of the need for an internet connection.</div><div>( As recommended in the =
second answer in<a href=3D"http://stackoverflow.com/questions/4806448/how-d=
o-i-install-from-a-local-cache-with-pip">http://stackoverflow.com/questions=
/4806448/how-do-i-install-from-a-local-cache-with-pip</a>&nbsp;<br></div><d=
iv>and alluded to in <a href=3D"http://carljm.github.com/tamingdeps">http:/=
/carljm.github.com/tamingdeps</a></div><div>and&nbsp;<a href=3D"http://www.=
pip-installer.org/en/latest/usage.html#install-packages">http://www.pip-ins=
taller.org/en/latest/usage.html#install-packages</a>&nbsp;)</div><div><br><=
/div><div>This does fill the cache directory with some tarballs:</div><div>=
&nbsp; $ ls $PIP_CACHE</div><div>&nbsp;&nbsp;buildbot-0.8.8-pre-121-g0ea11a=
4.zip &nbsp;distribute-0.6.28.tar.gz &nbsp;python-dateutil-1.5.tar.gz &nbsp=
;sqlalchemy-migrate-0.7.2.tar.gz &nbsp;Twisted-12.2.0.tar.bz2</div><div><di=
v>&nbsp; decorator-3.3.3.tar.gz &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; Jinja2-2.6.tar.gz &nbsp; &nbsp; &nbsp; &nbsp; SQLAlchemy-0.7.8.tar.gz=
 &nbsp; &nbsp; Tempita-0.5.1.tar.gz &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; zope.interface-4.0.1.tar.gz</div></div><div>but sadly, installing on the=
 isolated system fails with</div><div><br></div><div><div>&nbsp; Running se=
tup.py egg_info for package from file:///home/buildbot/master-state/sandbox=
/buildbot-git/master</div><div>&nbsp; &nbsp; Download error on http://pypi.=
python.org/simple/setuptools_trial/: [Errno 101] Network is unreachable -- =
Some packages may not be found!</div><div>&nbsp; &nbsp; Download error on h=
ttp://pypi.python.org/simple/setuptools-trial/: [Errno 101] Network is unre=
achable -- Some packages may not be found!</div><div>&nbsp; &nbsp; Couldn't=
 find index page for 'setuptools_trial' (maybe misspelled?)</div><div>&nbsp=
; &nbsp; Download error on http://pypi.python.org/simple/: [Errno 101] Netw=
ork is unreachable -- Some packages may not be found!</div><div>&nbsp; &nbs=
p; No local packages or download links found for setuptools-trial</div><div=
>&nbsp; &nbsp; Traceback (most recent call last):</div><div>&nbsp; &nbsp; &=
nbsp; File "&lt;string&gt;", line 14, in &lt;module&gt;</div><div>&nbsp; &n=
bsp; &nbsp; File "/home/buildbot/master-state/sandbox/buildbot-git/master/s=
etup.py", line 216, in &lt;module&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;=
 setup(**setup_args)</div><div>&nbsp; &nbsp; &nbsp; File "/usr/lib/python2.=
7/distutils/core.py", line 112, in setup</div><div>&nbsp; &nbsp; &nbsp; &nb=
sp; _setup_distribution =3D dist =3D klass(attrs)</div><div>&nbsp; &nbsp; &=
nbsp; File "/home/buildbot/master-state/sandbox/local/lib/python2.7/site-pa=
ckages/distribute-0.6.24-py2.7.egg/setuptools/dist.py", line 221, in __init=
__</div><div>&nbsp; &nbsp; &nbsp; &nbsp; self.fetch_build_eggs(attrs.pop('s=
etup_requires'))</div><div>&nbsp; &nbsp; &nbsp; File "/home/buildbot/master=
-state/sandbox/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.eg=
g/setuptools/dist.py", line 245, in fetch_build_eggs</div><div>&nbsp; &nbsp=
; &nbsp; &nbsp; parse_requirements(requires), installer=3Dself.fetch_build_=
egg</div><div>&nbsp; &nbsp; &nbsp; File "/home/buildbot/master-state/sandbo=
x/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resourc=
es.py", line 576, in resolve</div><div>&nbsp; &nbsp; &nbsp; &nbsp; dist =3D=
 best[req.key] =3D env.best_match(req, self, installer)</div><div>&nbsp; &n=
bsp; &nbsp; File "/home/buildbot/master-state/sandbox/local/lib/python2.7/s=
ite-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 821, in be=
st_match</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return self.obtain(req, inst=
aller) # try and download/install</div><div>&nbsp; &nbsp; &nbsp; File "/hom=
e/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/distribut=
e-0.6.24-py2.7.egg/pkg_resources.py", line 833, in obtain</div><div>&nbsp; =
&nbsp; &nbsp; &nbsp; return installer(requirement)</div><div>&nbsp; &nbsp; =
&nbsp; File "/home/buildbot/master-state/sandbox/local/lib/python2.7/site-p=
ackages/distribute-0.6.24-py2.7.egg/setuptools/dist.py", line 294, in fetch=
_build_egg</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return cmd.easy_install(re=
q)</div><div>&nbsp; &nbsp; &nbsp; File "/home/buildbot/master-state/sandbox=
/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/c=
ommand/easy_install.py", line 583, in easy_install</div><div>&nbsp; &nbsp; =
&nbsp; &nbsp; raise DistutilsError(msg)</div><div>&nbsp; &nbsp; distutils.e=
rrors.DistutilsError: Could not find suitable distribution for Requirement.=
parse('setuptools-trial')</div></div><div><br></div><div>I see from&nbsp;</=
div><div>&nbsp;<a href=3D"https://groups.google.com/forum/?fromgroups=3D#!t=
opic/python-virtualenv/K05_oEBiRPw">https://groups.google.com/forum/?fromgr=
oups=3D#!topic/python-virtualenv/K05_oEBiRPw</a><br></div><div>&nbsp;<a hre=
f=3D"http://lists.debian.org/debian-release/2010/08/msg01621.html">http://l=
ists.debian.org/debian-release/2010/08/msg01621.html</a><br></div><div>and<=
/div><div>&nbsp;<a href=3D"http://packages.ubuntu.com/precise/all/python-vi=
rtualenv/filelist">http://packages.ubuntu.com/precise/all/python-virtualenv=
/filelist</a><br></div><div>that the directory /usr/share/python-virtualenv=
 is where setuptools</div><div>comes from. &nbsp;Should there be a setuptoo=
ls_trial egg there, too?</div><div>Or should setuptools_trial somehow be in=
 my $PIP_CACHE?</div><div><br></div><div>I'll gladly take a workaround like=
 "just pre-install setuptools_trial like this".</div><div><br></div><div>(T=
his is made harder to debug by my visceral hatred of complex systems that m=
ake it hard to achieve repeatable builds, and of rabbithole ecosystems in g=
eneral. &nbsp;I'm trying to keep an open mind, but it's hard when you're a =
curmudgeon.)<br></div><div><br></div><div>Thanks,</div><div>Dan</div><div><=
br></div>
------=_Part_1741_14829826.1347583900441--

------=_Part_1740_28691948.1347583900441--