pip 和 conda 到底有什么不一样?

今天看到我的foreman开始报错去询问才发现。我们的python包管理工具已经从pip整体迁移到了conda。。最近的迁移真的非常多。。前端也在迁移打包🔧。

跟着发的教程弄了半天总算搞定,但是我非常疑惑。

为什么疑惑。。因为既然都是关于python的包管理工具为什么有了pip 我们还需要conda?在stackoverflow上搜到了答案 所以。我只做中文搬运 不做过多的污染

 

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.
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.

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

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 but they do not interoperate either.

在python的世界里也浸淫多年了,我们早已习惯有 pip ,easy_install 和virtualenv的世界,但是这些🔧没有解决我们所有的需求哦。这其中主要的问题是他们全部都集中解决关于python相关问题而忽略了非python库的依赖关系。(这句我没他看明白),就像 HDF5, MKL LLVM,etc等,在他们的源码中并没有setup.py这种东西而且也没有安装文件在python的site-packages 目录中。

所有conda就是一个包管理🔧和安装🔧,他就是要做比pip更多的事情;在python-site-packages之外管理python 库依赖关系。 而且conda同样也像virtualenv一样创建一个虚拟环境。

conda可以让你同时管理安装处理你有关python的任务和跟python无关的任务

conda使用了一个新的包格式,你不能交替使用pip 和conda。因为pip不能安装和解析conda的包格式。你可以使用两个工具 但是他们是不能交互的。

另外我个人由于经常忘记conda环境的启动命令也在这里记录一下
启动
source activate xxx

关闭
source deactivate

更新
conda env update -f environment.yml 更新配置文件

导出 .yml
conda env export >
environment.yml

导出 .txt
conda list --export > package-list.txt

conda create --name <env> --file <this file>


 

posted @ 2015-12-18 15:48  piperck  阅读(65280)  评论(0编辑  收藏  举报