1.安装pip工具
[root@tongc-yum162 ~]# wget
[root@tongc-yum162 ~]# cd setuptools-40.0.0
[root@tongc-yum162 setuptools-40.0.0]# python setup.py install
[root@tongc-yum162 ~]# wget
[root@tongc-yum162 ~]# tar xvf pip-10.0.1.tar.gz
[root@tongc-yum162 ~]# cd pip-10.0.1
[root@tongc-yum162 pip-10.0.1]# python setup.py install
2.pip源配置
[root@tongc-yum162 pip-10.0.1]# mkdir -p /var/www/html/python
[root@tongc-yum162 pip-10.0.1]# pip install pip2pi
3.配置网络源(下载网上的python模块)
[root@tongc-yum162 ~]# vim ~/.pip/pip.conf
[global]
index-url = http://pypi.douban.com/simple/
[install]
trusted-host = pypi.douban.com
[root@tongc-yum162 ~]#
4.下载单个模块
[root@tongc-yum162 ~]# pip2tgz /var/www/html/python hdfs
5.模块批量同步
[root@tongc-yum162 ~]# pip2tgz /var/www/html/python -r 1.txt