0

There is a need to install python packages on machine without internet connection

I used pip download to download the packages and their dependencies

I copied all the dependencies to the offline machine

I run pip from the local python packages repository using

pip install * 

package with dependencies are trying to access the internet to download their dependencies even that they are locate in the same directory

I would like to avoid the requirement.txt file and would like it to install all the packages from the local directory with their dependencies.

Is there any way to do so?

Nimrod
  • 43
  • 4
  • 1
    Possible duplicate of [Download python package with dependencies without installing](https://stackoverflow.com/questions/22092927/download-python-package-with-dependencies-without-installing) – Aaron_ab May 22 '19 at 13:34
  • 1
    Possible duplicate of [Python Packages Offline Installation](https://stackoverflow.com/questions/11091623/python-packages-offline-installation) – Dorian Turba May 22 '19 at 13:44

2 Answers2

0

It's possible to download the wheels directly for each package, and once you have them on the machine you can run pip install name-of-wheel.whl and it will install them without routing to pypi.

Nordle
  • 2,915
  • 3
  • 16
  • 34
0

You can use on the online machine:

pip download -r requirements.txt

to download package without installing them.

Then, on the offline machine:

pip install --no-index --find-links /path/to/download/dir/ -r requirements.txt

Source: Python Packages Offline Installation

Dorian Turba
  • 3,260
  • 3
  • 23
  • 67