pip 和 conda 有什么区别? [英] What is the difference between pip and conda?

查看:33
本文介绍了pip 和 conda 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 pip 是 python 包的包管理器.但是,我在IPython的网站上看到安装使用conda来安装IPython.

I know pip is a package manager for python packages. However, I saw the installation on IPython's website use conda to install IPython.

我可以使用 pip 安装 IPython 吗?当我已经有了 pip 时,为什么要使用 conda 作为另一个 python 包管理器?

Can I use pip to install IPython? Why should I use conda as another python package manager when I already have pip?

pipconda 有什么区别?

推荐答案

引用自 Conda 博客:

涉足python世界这么久,我们都知道pip、easy_install和virtualenv,但这些工具并没有满足我们所有的具体要求.主要问题是他们专注于 Python,忽略了非 Python 库依赖项,例如 HDF5、MKL、LLVM 等,它们的源代码中没有 setup.py,也不会将文件安装到 Python 的站点中-packages 目录.

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.

所以 Conda 是一个打包工具和安装程序,其目的不仅仅是 pip 所做的;处理 Python 包的外部库依赖项以及 Python 包本身.Conda 还创建了一个虚拟环境,就像 virtualenv 所做的那样.

So Conda is a packaging tool and installer that aims to do more than what pip does; handle library dependencies outside of the Python packages as well as the Python packages themselves. Conda also creates a virtual environment, like virtualenv does.

因此,应该将 Conda 与 Buildout 进行比较,也许是另一种可以让您处理Python 和非 Python 安装任务.

As such, Conda should be compared to Buildout perhaps, another tool that lets you handle both Python and non-Python installation tasks.

因为 Conda 引入了一种新的打包格式,您不能将 pip 和 Conda 互换使用;pip 无法安装 Conda 包格式.您可以并排使用这两个工具(通过安装 pipconda install pip),但它们也不能互操作.

Because Conda introduces a new packaging format, you cannot use pip and Conda interchangeably; pip cannot install the Conda package format. You can use the two tools side by side (by installing pip with conda install pip) but they do not interoperate either.

自从写下这个答案后,Anaconda 发布了一个新页面Understanding Conda和 Pip,这也呼应了这一点:

Since writing this answer, Anaconda has published a new page on Understanding Conda and Pip, which echoes this as well:

这突出了 conda 和 pip 之间的主要区别.Pip 安装 Python 包,而 conda 安装可能包含用任何语言编写的软件的包.例如,在使用 pip 之前,必须通过系统包管理器或通过下载并运行安装程序来安装 Python 解释器.另一方面,Conda 可以直接安装 Python 包以及 Python 解释器.

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.

然后继续

有时需要一个包,它不是 conda 包,但在 PyPI 上可用,可以用 pip 安装.在这些情况下,尝试同时使用 conda 和 pip 是有意义的.

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 和 conda 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆