Having been involved in the python world for so long, we are all aware of pip, easy_install, and virtualenv, but these tools did not meet all of our specific requirements. The main problem is that they are focused around Python, neglecting non-Python library dependencies, such as HDF5, MKL, LLVM, etc., which do not have a setup.py in their source code and also do not install files into Python’s site-packages directory.
This highlights a key difference between conda and pip. Pip installs Python packages whereas conda installs packages which may contain software written in any language. For example, before using pip, a Python interpreter must be installed via a system package manager or by downloading and running an installer. Conda on the other hand can install Python packages as well as the Python interpreter directly.
更进一步
Occasionally a package is needed which is not available as a conda package but is available on PyPI and can be installed with pip. In these cases, it makes sense to try to use both conda and pip.
其他的答案对细节有一个公平的描述,但我想强调一些高层次的观点。
pip是一个包管理器,它有助于安装、升级和卸载python包。它也适用于虚拟的python环境。
conda是任何软件(安装、升级和卸载)的包管理器。它也适用于虚拟系统环境。
conda的设计目标之一是方便用户对整个软件栈的包管理,其中一个或多个python版本可能只是一个很小的部分。这包括低级库,如线性代数、编译器(如Windows上的mingw)、编辑器、版本控制工具(如Hg和Git)或其他需要分发和管理的工具。
对于版本管理,pip允许您在多个python环境之间切换和管理。
Conda允许您在多个通用环境之间切换和管理,在这些环境中,多个其他东西的版本号可能会有所不同,如C库、编译器、测试套件或数据库引擎等等。
Conda不是以Windows为中心的,但在Windows上,当需要安装和管理需要编译的复杂科学包时,它是目前可用的最佳解决方案。
当我想到在Windows上尝试通过pip编译这些包,或者在需要编译时调试失败的
pip install
会话,我会流泪。最后,Continuum Analytics还托管(免费的)binstar.org(现在称为anaconda.org),允许常规包开发人员创建自己的自定义(构建!)软件包用户可以从中
conda install
使用的软件堆栈。下面是一个简短的摘要:
皮普
康达
conda build
的工具可以从源代码构建包,但是conda install
本身可以从已经构建的Conda包安装东西。在这两种情况下:
Conda的前两个要点确实使它在许多包中优于pip。由于pip是从源代码安装的,如果您无法编译源代码(在Windows上尤其如此,但在Linux上,如果软件包有一些困难的C或FORTRAN库依赖项,则安装pip可能会很痛苦)。Conda从binary安装,这意味着有人(例如Continuum)已经完成了编译包的艰苦工作,因此安装很容易。
如果您对构建自己的包感兴趣,也会有一些差异。例如,pip是建立在setuptools之上的,而Conda使用自己的格式,这有一些优点(比如是静态的,再一次是Python不可知的)。
引用Conda blog:
因此Conda是一个打包工具和安装程序,它的目的不仅仅是做
pip
所做的事情;处理Python包和Python包本身之外的库依赖关系。Conda还创建了一个虚拟环境,就像virtualenv
那样。因此,Conda应该与Buildout进行比较,这也许是另一个让您同时处理Python和非Python安装任务的工具。
因为Conda引入了新的打包格式,所以不能使用
pip
和Conda可交换;pip
不能安装Conda包格式。您可以并排使用这两个工具(通过与conda install pip
一起安装pip
),但它们也不互操作。自从写了这个答案,Anaconda已经发布了一个new page on Understanding Conda and Pip,这也反映了这一点:
更进一步
相关问题 更多 >
编程相关推荐