如何打包发布Python包至私有仓库
如何打包发布Python包至私有仓库 Python 中的库(package)可以分为标准库和三方库,标注库是在安装Python后,默认安装的库,如math,json等。其余的库可以称之为三方库,需要在使用前单独安装。我们经常使用到 pip install <package> 这个命令就是用于安装三方库的。这里我们只需要指定包名即可非常简单的实现三方库的安装。那么包存储在什么地方,我们是从何处下载安装的呢? PyPi Pip install 命令支持四种来源的安装: PyPI (and other indexes) VCS 本地项目目录 本地/远程 的 archives Python 安装包教程:https://packaging.python.org/tutorials/installing-packages/#installing-packages 首先,我们介绍下什么是PyPi。PyPi 是The Python Package Index 的缩写,是Python社区用来开发和共享软件的一种软件仓库。 一般如果在使用 pip 安装、搜索第三方Python库的时候,默认使用 Pypi源,若是希望使用其余(私有)的源,可以通过 -i/--index-url指定。 -i, --index-url <url> Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format. 如经常使用 清华Pypi镜像 加速某些包下载时经常使用如下方式...