first of all I have managed to install Ansible on a server which has no internet access. But I wonder if my approach is correct.
At first I downloaded the necessary dependencies via pip3.
pip3 download ansible -d .
This resulted in the following files downloaded:
ansible-2.9.4.tar.gz
cryptography-2.8-cp34-abi3-manylinux1_x86_64.whl
MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
PyYAML-5.3.tar.gz
cffi-1.13.2-cp36-cp36m-manylinux1_x86_64.whl
Jinja2-2.11.1-py2.py3-none-any.whl
pycparser-2.19.tar.gz
six-1.14.0-py2.py3-none-any.whl
Now that I have made these files available on my remote computer, I tried to use
pip3 install ansible-2.9.4.tar.gz
to install ansible.
This resulted in the following error:
Processing ./ansible-2.9.4.tar.gz
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at
0x7f00726f9ef0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/jinja2/
So I tried to install Jinja2 manually:
pip3 install jinja2-2.11.1-py2.py3-none-any.whl
But this did not work either:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection
broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at
0x7fd303a23940>: Failed to establish a new connection: [Errno -2] Name or service not known',)':
/simple/markupsafe/
After Markupsafe was installed, Jinja2 could be installed as well. In the end with pip3 install ansible-2.9.4.tar.gz I successfully installed ansible.
Now my question is. Is there a way to tell pip to use the downloaded files to install the dependencies or is there an easier approach to install a specific python package with all its dependencies offline?
Thanks for your help and best regards. yabberth