1、通过 pip download 下载安装包
linux-oz6w:~
linux-oz6w:~
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
linux-oz6w:~
total 37156
-rw-r--r-- 1 root root 125774 Jan 6 22:44 Jinja2-2.11.2-py2.py3-none-any.whl
-rw-r--r-- 1 root root 24348 Jan 6 22:44 MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
-rw-r--r-- 1 root root 269377 Jan 6 22:44 PyYAML-5.3.1.tar.gz
-rw-r--r-- 1 root root 28622006 Jan 6 22:44 ansible-2.10.4.tar.gz
-rw-r--r-- 1 root root 5708083 Jan 6 22:44 ansible-base-2.10.4.tar.gz
-rw-r--r-- 1 root root 389322 Jan 6 22:44 cffi-1.14.4-cp27-cp27mu-manylinux1_x86_64.whl
-rw-r--r-- 1 root root 2626135 Jan 6 22:44 cryptography-3.3.1-cp27-cp27mu-manylinux2010_x86_64.whl
-rw-r--r-- 1 root root 11223 Jan 6 22:44 enum34-1.1.10-py2-none-any.whl
-rw-r--r-- 1 root root 18159 Jan 6 22:44 ipaddress-1.0.23-py2.py3-none-any.whl
-rw-r--r-- 1 root root 39857 Jan 6 22:44 packaging-20.8-py2.py3-none-any.whl
-rw-r--r-- 1 root root 112041 Jan 6 22:44 pycparser-2.20-py2.py3-none-any.whl
-rw-r--r-- 1 root root 67842 Jan 6 22:44 pyparsing-2.4.7-py2.py3-none-any.whl
-rw-r--r-- 1 root root 10963 Jan 6 22:44 six-1.15.0-py2.py3-none-any.whl
2、利用 pip install --no-index 离线安装
linux-oz6w:~
Looking in links: /root/pip-ansible/
......
Successfully installed MarkupSafe-1.1.1 PyYAML-5.3.1 ansible-2.10.4 ansible-base-2.10.4 cffi-1.14.4 cryptography-3.3.1 enum34-1.1.10 ipaddress-1.0.23 jinja2-2.11.2 packaging-20.8 pycparser-2.20 pyparsing-2.4.7 six-1.15.0
-----------------------------------------------------------------------------------
--no-index
--find-links
--ignore-installed
/root/pip-ansible/ansible-2.10.4.tar.gz