In order to make packages installed offline, I use the -d (or --download) option to pip install
. For instance, pip install --download dependencies -r requirements.txt
will download the packages for all required dependencies mentioned in requirements.txt
to dependencies
dir (but will not install them). Then I use pip install --no-index --find-links dependencies -r requirements.txt
to install those downloaded packages without accessing the network.
Most of the time it works fine, but sometimes installation fails with error "Could not find a version that satisfies the requirement xyz". After doing pip install --user xyz --find-links dependencies
manually (xyz IS present in the dependencies folder), installation fails with the same "Could not find a version that satisfies the requirement abc" error, but with different package 'abc'. It repeats several times until I manually resolve all failed dependencies.
How could I make run pip install --no-index --find-links dependencies -r requirements.txt
without those weird dependency errors not finding packages that are already there?