15

I need to download a python package with all its dependencies without installing, sneaker-net it to a computer without connection to the internet, and install it there. For example, I want to install buildbot, lettuce, etc.

The computer is a Windows 7 machine, using Python 2.7. If the package has native extensions, I can build them on the computer.

dkrikun
  • 888
  • 1
  • 10
  • 22

1 Answers1

18

You can use pip, with the --download option, which will download the main package and its dependancies, without installing them.

pip install --download="/path/to/downloaded/files" sneaker-net

And use these files one the local machine with:

pip install --no-index --find-links=<DIR on local machine> sneaker-net

See pip documentation --download for fast & local installs. You can use pip on Windows with cygwin for example.

Maxime Lorant
  • 28,973
  • 16
  • 79
  • 93
  • I'm trying to run `pip` on Windows, does it only work with cygwin? – dkrikun Feb 28 '14 at 10:52
  • @dkrikun See this question for more information on pip on Windows: http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows Very useful tool, it's always useful to have it installed :) – Maxime Lorant Feb 28 '14 at 10:53
  • Thx, exactly what I needed – dkrikun Feb 28 '14 at 10:59
  • 19
    For those, who read this answer in 2018 or later: modern pip can do `pip download ` for you – Andrew Apr 23 '18 at 18:48
  • I want to download and store the packages on a work network location. The reason is that proxy issues always plague all attempts at using Git and pip. Thus I want to have them downloaded by IT once and then stored on a local network location from which we shall download and install them. – Quantum0xE7 Sep 27 '20 at 21:42
  • *Warning*: `pip download` involves, somewhat unexpectedly, [execution of the remote code](https://stackoverflow.com/q/52486985/674039). It should only be used if you trust the package and all its dependencies. – wim Apr 09 '21 at 19:19