搭建python本地源

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了搭建python本地源相关的知识,希望对你有一定的参考价值。

1.安装pip工具

[[email protected] ~]# wget https://files.pythonhosted.org/packages/d3/3e/1d74cdcb393b68ab9ee18d78c11ae6df8447099f55fe86ee842f9c5b166c/setuptools-40.0.0.zip

[[email protected] ~]# cd setuptools-40.0.0

[[email protected] setuptools-40.0.0]# python setup.py  install

[[email protected] ~]# wget https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz

[[email protected] ~]# tar xvf pip-10.0.1.tar.gz

[[email protected] ~]# cd pip-10.0.1

[[email protected] pip-10.0.1]# python setup.py  install


2.pip源配置

[[email protected] pip-10.0.1]# mkdir -p /var/www/html/python

[[email protected] pip-10.0.1]# pip install pip2pi


3.配置网络源(下载网上的python模块)

[[email protected] ~]# vim ~/.pip/pip.conf

[global]

index-url = http://pypi.douban.com/simple/

[install]

trusted-host = pypi.douban.com

[[email protected] ~]#


4.下载单个模块

[[email protected] ~]# pip2tgz /var/www/html/python hdfs


5.模块批量同步

[[email protected] ~]# pip2tgz /var/www/html/python -r 1.txt


以上是关于搭建python本地源的主要内容,如果未能解决你的问题,请参考以下文章

CentOS 如何搭建本地和局域网yum源

[Pipy]利用pip2pi搭建本地pypi源

搭建本地yum源

centos7.5利用yum缓存搭建本地源

Linux 红帽9.0 本地源 与 网络源 搭建

[Linux]CentOS7搭建/配置:YUM仓库/源[本地源/HTTP源/自建源仓库][转]