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

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

pip和conda的区别是什么?


当前回答

PIP是一个包管理器。

Conda既是包管理器,也是环境管理器。

细节:

依赖项检查

Pip and conda also differ in how dependency relationships within an environment are fulfilled. When installing packages, pip installs dependencies in a recursive, serial loop. No effort is made to ensure that the dependencies of all packages are fulfilled simultaneously. This can lead to environments that are broken in subtle ways, if packages installed earlier in the order have incompatible dependency versions relative to packages installed later in the order. In contrast, conda uses a satisfiability (SAT) solver to verify that all requirements of all packages installed in an environment are met. This check can take extra time but helps prevent the creation of broken environments. As long as package metadata about dependencies is correct, conda will predictably produce working environments.

参考文献

理解康达和皮普

其他回答

我可以用pip安装iPython吗?

当然,两者都有(第一个方法)

pip install ipython

(第三种方法,第二种是conda)

您可以从GitHub或PyPI手动下载IPython。安装一个 对于这些版本,解压它并从顶层运行以下命令 源目录使用终端: PIP安装。

都是官方推荐的安装方式。

当我已经有pip时,为什么我要使用conda作为另一个python包管理器?

正如这里所说:

如果您需要一个特定的包(可能只用于一个项目),或者需要与其他人共享该项目,那么conda似乎更合适。

Conda在(YMMV)中超过pip

使用非python工具的项目 与同事分享 版本切换 在具有不同库版本的项目之间切换

pip和conda的区别是什么?

每个人都广泛地回答了这个问题。

PIP是一个包管理器。

Conda既是包管理器,也是环境管理器。

细节:

依赖项检查

Pip and conda also differ in how dependency relationships within an environment are fulfilled. When installing packages, pip installs dependencies in a recursive, serial loop. No effort is made to ensure that the dependencies of all packages are fulfilled simultaneously. This can lead to environments that are broken in subtle ways, if packages installed earlier in the order have incompatible dependency versions relative to packages installed later in the order. In contrast, conda uses a satisfiability (SAT) solver to verify that all requirements of all packages installed in an environment are met. This check can take extra time but helps prevent the creation of broken environments. As long as package metadata about dependencies is correct, conda will predictably produce working environments.

参考文献

理解康达和皮普

为了不让你们更困惑, 但是你也可以在conda环境中使用PIP,它会验证上面的一般管理器注释和特定于python的管理器注释。

conda install -n testenv pip
source activate testenv
pip <pip command>

您还可以将PIP添加到任何环境的默认包中,以便每次都显示它,这样您就不必遵循上面的代码段。

I may have found one further difference of a minor nature. I have my python environments under /usr rather than /home or whatever. In order to install to it, I would have to use sudo install pip. For me, the undesired side effect of sudo install pip was slightly different than what are widely reported elsewhere: after doing so, I had to run python with sudo in order to import any of the sudo-installed packages. I gave up on that and eventually found I could use sudo conda to install packages to an environment under /usr which then imported normally without needing sudo permission for python. I even used sudo conda to fix a broken pip rather than using sudo pip uninstall pip or sudo pip --upgrade install pip.

pip仅用于Python

conda只适用于Anaconda +其他科学包,如R依赖等。并不是每个人都需要蟒蛇,因为它已经和Python一起出现了。Anaconda主要是为那些做机器学习/深度学习等的人准备的。普通的Python开发人员不会在他的笔记本电脑上运行Anaconda。