installing python packages without internet and using source code as .tar.gz and .whl
we are trying to install couple of python packages without internet.
For ex : python-keystoneclient
For that we have the packages downloaded from https://pypi.python.org/pypi/python-keystoneclient/1.7.1 and kept it in server.
However, while installing tar.gz and .whl packages , the installation is looking for dependent packages to be installed first. Since there is no internet connection in the server, it is getting failed.
For ex : For python-keystoneclient we have the following dependent packages
stevedore (>=1.5.0)
six (>=1.9.0)
requests (>=2.5.2)
PrettyTable (<0.8,>=0.7)
oslo.utils (>=2.0.0)
oslo.serialization (>=1.4.0)
oslo.i18n (>=1.5.0)
oslo.config (>=2.3.0)
netaddr (!=0.7.16,>=0.7.12)
debtcollector (>=0.3.0)
iso8601 (>=0.1.9)
Babel (>=1.3)
argparse
pbr (<2.0,>=1.6)
When i try to install packages one by one from the above list, once again its looking for nested dependency .
Is there any way we could list ALL the dependent packages for installing a python module like python-keystoneclient.
This is how I handle this case:
On the machine where I have access to Internet:
mkdir keystone-deps
pip download python-keystoneclient -d "/home/aviuser/keystone-deps"
tar cvfz keystone-deps.tgz keystone-deps
Then move the tar file to the destination machine that does not have Internet access and perform the following:
tar xvfz keystone-deps.tgz
cd keystone-deps
pip install python_keystoneclient-2.3.1-py2.py3-none-any.whl -f ./ --no-index
You may need to add --no-deps to the command as follows:
pip install python_keystoneclient-2.3.1-py2.py3-none-any.whl -f ./ --no-index --no-deps
If you want to install a bunch of dependencies from, say a requirements.txt, you would do:
mkdir dependencies
pip download -r requirements.txt -d "./dependencies"
tar cvfz dependencies.tar.gz dependencies
And, once you transfer the dependencies.tar.gz to the machine which does not have internet you would do:
tar zxvf dependencies.tar.gz
cd dependencies
pip install * -f ./ --no-index