Python - What's PyPi, pip, easy_install, setuptools, eggs, wheel, Buildout?

栏目: Python · 发布时间: 8年前

内容简介:Python - What's PyPi, pip, easy_install, setuptools, eggs, wheel, Buildout?

在开始之前,可以先看看下面这篇有意思的博客,可以帮助你更好的了解 Python 的包管理:

Python Packaging 编年史

What is PyPI?

The Python Package Index (aka PyPI) is the official third-party software repository for the Python

PyPI(Python Package Index) 是 python 官方的第三方库的仓库,所有人都可以下载第三方库或上传自己开发的库到 PyPI。PyPI 推荐使用 pip 包管理器来下载第三方库。

What is pip?

pip (package manager). pip is a is a command-line program used to {install, remove, update, …} software packages written in Python.
  1. https://pip.pypa.io/en/stable/

  2. https://pip.pypa.io/en/stable/installing/

What is easy_install?

Easy Install is a python module ( easy_install ) bundled with setuptools that lets you automatically download, build, install, and manage Python packages.

可见 easy_install 只是 setuptools 的一个 module,它拥有部分的包管理的功能,但是没有 pip 那么全。

esay_install 文档

pip vs easy_install

pip 与 easy_install 的对比

简单来说,pip 比 easy_install 出现的要晚,pip 的出现是为了改进 easy_install,更好的支持 python 包管理,但是 pip 也不能完全替代 easy_install,有些功能它依然不如 easy_install,比如 pip 不兼容一些广泛使用而且高度定制化的包,比如 distutils 和 setuptools。

What is distutils?

The distutils package provides support for building and installing additional modules into a Python installation

distutils 是 python 标准库的一部分,用来在 python 环境中构建和安装额外的包。

distutils2 是 distutils 的高级版本,不过已经夭折,所以不需要关心了。

What is setuptools?

Easily download, build, install, upgrade, and uninstall Python packages.

Setuptools is a collection of enhancements to the Python distutils that allow developers to more easily build and distribute Python packages, especially ones that have dependencies on other packages

简单说 setuptools 是 distutils 的增强版

setuptools 介绍

setuptools 安装

what is ez_setup.py?

ez_setup.py 是一个引导文件,可以帮助你自动的下载和安装 setuptools.

source code

What is Eggs?

“Eggs are to Pythons as Jars are to Java…”

Eggs 格式是 setuptools 引入的一种文件格式,它使用 .egg 扩展名,用于 Python 模块的安装,setuptools 可以识别这种格式,并解析它,安装它。

Eggs 介绍

What is Wheel?

Wheels are the new standard of python distribution and are intended to replace eggs.

wheel 本质上是一个 zip 包格式,它使用 .whl 扩展名,用于 python 模块的安装,它的出现是为了替代 Eggs。Wheel 要优于 Eggs, 因为 Eggs 诞生的比较早,不符合目前的一些 package 的相关标准,而 wheels 并不存在这个问题。

  1. http://wheel.readthedocs.io/en/stable/
  2. https://pythonwheels.com/

what is Buildout?

Buildout is a tool for automating software assembly.

Buildout 是一个基于 Python 的构建工具, 通过一个配置文件,可以从多个部分创建、组装并部署你的应用,即使应用包含了非 Python 的组件,Buildout也能够胜任。Buildout 不但能够像 setuptools 一样自动更新或下载安装依赖包,而且还能够像 virtualenv 一样,构建一个封闭隔离的开发环境。(引用自博客 用Buildout来构建Python项目 )

Buildout 这个项目主要是为了解决两个问题:

  1. Application-centric assembly and deployment
  2. Repeatable assembly of programs from Python software distributions

zc.buildout 的介绍

Buildout 的安装通常由一个引导文件来完成:

下载链接: https://github.com/buildout/buildout/blob/master/bootstrap/bootstrap.py

同时还需要一个 buildout.cfg 的配置文件。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

引爆社群:移动互联网时代的新4C法则(第2版)

引爆社群:移动互联网时代的新4C法则(第2版)

唐兴通 / 机械工业出版社 / 69.00元

社群已经被公认为是这个时代的商业新形态,原有的商业逻辑和方法被颠覆,新的基于社群的商业体系和规则亟待构建,今天几乎所有的企业都在为此而努力,都在摸索中前行。 本书提出的“新4C法则”为社群时代的商业践行提供了一套科学的、有效的、闭环的方法论,第1版上市后获得了大量企业和读者的追捧,“新4C法则”在各行各业被大量解读和应用,积累了越来越多的成功案例,被公认为是社群时代通用的方法论。也因此,第1......一起来看看 《引爆社群:移动互联网时代的新4C法则(第2版)》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具