pip vs easy_install¶
easy_install,现已 deprecated,于 2004 年作为 Setuptools 的一部分发布。它当时的一个显著特点是使用需求说明符从 PyPI 安装 包,并自动安装依赖项。
:ref:`pip
于 2008 年发布,作为 easy_install 的替代工具,尽管它仍然主要构建在 Setuptools 组件之上。pip 当时的一个显著特点是 不 以 Eggs 格式安装包,也不从 Eggs 安装(而是直接从 sdists 安装),并引入了 Requirements Files 的概念,赋予用户轻松复制环境的能力。
以下是 pip 和已弃用的 easy_install 之间的重要差异:
pip |
easy_install |
|
Installs from Wheels |
Yes |
No |
Uninstall Packages |
Yes ( |
No |
Dependency Overrides |
Yes (Requirements Files) |
No |
List Installed Packages |
Yes ( |
No |
PEP 438 Support |
Yes |
No |
Installation format |
'Flat' packages with |
Encapsulated Egg format |
sys.path modification |
No |
Yes |
Installs from Eggs |
No |
Yes |
No |
Yes [1] |
|
No |
Yes |
|
Exclude scripts during install |
No |
Yes |
per project index |
Only in virtualenv |
Yes, via setup.cfg |
easy_install, now deprecated, was released in 2004 as part of Setuptools. It was notable at the time for installing packages from PyPI using requirement specifiers, and automatically installing dependencies.
pip came later in 2008, as alternative to easy_install, although still largely built on top of Setuptools components. It was notable at the time for not installing packages as Eggs or from Eggs (but rather simply as 'flat' packages from sdists), and introducing the idea of Requirements Files, which gave users the power to easily replicate environments.
Here's a breakdown of the important differences between pip and the deprecated easy_install:
pip |
easy_install |
|
Installs from Wheels |
Yes |
No |
Uninstall Packages |
Yes ( |
No |
Dependency Overrides |
Yes (Requirements Files) |
No |
List Installed Packages |
Yes ( |
No |
PEP 438 Support |
Yes |
No |
Installation format |
'Flat' packages with |
Encapsulated Egg format |
sys.path modification |
No |
Yes |
Installs from Eggs |
No |
Yes |
No |
Yes [1] |
|
No |
Yes |
|
Exclude scripts during install |
No |
Yes |
per project index |
Only in virtualenv |
Yes, via setup.cfg |