搭建python本地源

1.安裝pip工具
html

[root@tongc-yum162 ~]# wget https://files.pythonhosted.org/packages/d3/3e/1d74cdcb393b68ab9ee18d78c11ae6df8447099f55fe86ee842f9c5b166c/setuptools-40.0.0.zip python

[root@tongc-yum162 ~]# cd setuptools-40.0.0vim

[root@tongc-yum162 setuptools-40.0.0]# python setup.py  install網絡

[root@tongc-yum162 ~]# wget https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz ide

[root@tongc-yum162 ~]# tar xvf pip-10.0.1.tar.gz工具

[root@tongc-yum162 ~]# cd pip-10.0.1url

[root@tongc-yum162 pip-10.0.1]# python setup.py  install3d


2.pip源配置htm

[root@tongc-yum162 pip-10.0.1]# mkdir -p /var/www/html/pythonip

[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

相關文章
相關標籤/搜索