-1

I want to install packages without using the Internet.

I searched for it. For example, using this reference:

pip install relative_path_to_seaborn.tar.gz

But I think if I can not consider package dependencies , it can not be installed properly.

In R, using library miniCRAN, consider dependencies.

So how to install packages without the Internet connection and taking into account the package dependencies?

kahveci
  • 1,429
  • 9
  • 23
이성령
  • 1,264
  • 3
  • 19
  • 23

1 Answers1

1

One of the simpler methods it to use pip wheel if you are going to install on the same platform.

$ mkvirtualenv -p python3 foo
$ mkdir baz ; cd baz
$ pip wheel pip wheel numpy pandas seaborn

Will download the dependencies to the local directory.

$ pip install ./*.whl
Installing collected packages: six, cycler, kiwisolver, pyparsing, pytz, python-dateutil, matplotlib, pandas, scipy, seaborn

You can also use pip download but it is less likely to grab all of the needed sub-dependencies.

Where as the output from pip wheel will show:

  Saved ./Glances-2.11.1-cp36-none-any.whl
Collecting python-dateutil>=2.5.0 (from pandas)

You can copy or specify a directory to save to then install with:

$ pip install --no-index --find-links=/srv/foo/wheels project

If you have larger needs you can use projects like devpi or pyenv or consider using fpm to create rpms, debs, pkgs etc...

gdahlm
  • 1,132
  • 7
  • 8
  • thanks, but i can not understand the method... how to use it...did you know easy method like miniCRAN packges in R?? miniCRAN provide related packages.tar.gz considered dependencies in directed local repository. – 이성령 Jun 23 '18 at 03:11
  • `pip wheel` is similar here is a link to the docs. https://pip.pypa.io/en/latest/user_guide/#installation-bundles – gdahlm Jun 23 '18 at 03:25