20

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
  • 1,228
  • 1
  • 15
  • 23

1 Answers1

23

You can use pip, with the --download option, which will download the main package and its dependencies, 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.

Kevin C
  • 4,851
  • 8
  • 30
  • 64
Maxime Lorant
  • 34,607
  • 19
  • 87
  • 97
  • 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
  • 26
    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. – gyuunyuu 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
  • new version: pip3 download sneaker-net ----- this will download into the current directory – horace Dec 26 '22 at 22:34