本文转自Understanding Conda and Pip

Conda and pip are often considered as being nearly identical. Although some of the functionality of these two tools overlap, they were designed and should be used for different purposes. Pip is the Python Packaging Authority’s recommended tool for installing packages from the Python Package Index, PyPI. Pip installs Python software packaged as wheels or source distributions. The latter may require that the system have compatible compilers, and possibly libraries, installed before invoking pip to succeed.

Conda is a cross platform package and environment manager that installs and manages conda packages from the Anaconda repository as well as from the Anaconda Cloud. Conda packages are binaries. There is never a need to have compilers available to install them. Additionally conda packages are not limited to Python software. They may also contain C or C++ libraries, R packages or any other software.

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.

Another key difference between the two tools is that conda has the ability to create isolated environments that can contain different versions of Python and/or the packages installed in them. This can be extremely useful when working with data science tools as different tools may contain conflicting requirements which could prevent them all being installed into a single environment. Pip has no built in support for environments but rather depends on other tools like virtualenv or venv to create isolated environments. Tools such as pipenv, poetry, and hatch wrap pip and virtualenv to provide a unified method for working with these environments.

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.

Given the similarities between conda and pip, it is not surprising that some try to combine these tools to create data science environments. A major reason for combining pip with conda is when one or more packages are only available to install via pip. Over 1,500 packages are available in the Anaconda repository, including the most popular data science, machine learning, and AI frameworks. These, along with thousands of additional packages available on Anaconda cloud from channeling including conda-forge and bioconda, can be installed using conda. Despite this large collection of packages, it is still small compared to the over 150,000 packages available on PyPI. 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.

Comparison of conda and pip

  conda pip

manages

binaries wheel or source
can require compilers no yes
package types any Python-only
create environment yes, built-in no, requires virtualenv or venv
dependency checks

yes

no

package sources

Anaconda repo and cloud

PyPI

conda和pip的区别相关推荐

  1. python install pip 区别_python conda、pip区别,python 下 faiss 安装

    在安装一些python的安装包时,我们会使用conda install ~或者pip install ~ 网上说conda是安装到云端,而pip是安装到本地,那二者究竟有什么区别,可以参考下这个点击打 ...

  2. Spyder,jupter 的基本使用方法---python(conda安装和pip安装区别)(图片导入、网页导入、音频导入)

    视频地址:https://v.youku.com/v_show/id_XMzQ5Mjk5NjYyMA==.html 学习心得 清屏 在控制界面输入: %clear 或者 快捷键 :Ctrl + L 查 ...

  3. anaconda中的python如何进行关联分析_Anaconda、Miniconda、Conda、pip的相互关系

    Anaconda.Miniconda.Conda.pip的相互关系.如果你想要跳过这篇文章,并得到讨论的要点,你可以阅读每个标题以及下面的摘要. 认为#1:Conda是一个发行版,不是一个软件包管理器 ...

  4. jupyter和spider;Anaconda、Python、Jupyter、Pycharm、Spyder、conda、pip

    转自https://www.jianshu.com/p/97fa4ed3edbc.自学使用,侵删. Anaconda安装后,可以从菜单中看到它包含几个应用程序,其中Anaconda Navigator ...

  5. conda和pip不同

    在安装一些python的安装包时,我们会使用conda install ~或者pip install ~ 网上说conda是安装到云端,而pip是安装到本地,那二者究竟有什么区别,可以参考下这个点击打 ...

  6. 修改anaconda中conda和pip的源为清华源

    修改anaconda中conda和pip的源为清华源 注: 当前清华源已经过期,请勿在使用该博文conda源 最近又用回python,并且使用anaconda来进行包的管理,但是在下载某些库十分慢,于 ...

  7. 如何在智星云主机配置 conda 和 pip 源

    一.配置conda源 1. conda源更换为北京外国语大学 Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算.数 ...

  8. conda虚拟环境pip装包总装载总环境中解决办法

    conda虚拟环境pip装包总装载总环境中解决办法 1.首先进入自己的虚拟环境中 2.不要直接pip install 3.使用下面格式安装 python -m pip install 或者 pytho ...

  9. Azure VIP,DIP,PIP的区别

    Azure公有云中有以下3种常见的IP地址: VIP,公用虚拟IP地址 DIP,内部IP地址 PIP,实例级公用IP地址 为了更容易理解Azure VIP,DIP,PIP的区别,请先仔细查看下图.

最新文章

  1. hadoop之MapReduce框架TaskTracker端心跳机制分析(源码分析第六篇)
  2. php酒店预定,php酒店查询预约系统
  3. Python 生成器(yield)
  4. JS引擎、运行时与调用栈概述
  5. 安装DNN时,数据库连接字符串的设置
  6. 叛乱2正版怎么创服务器,Insurgency Linux Server 叛乱2创建服务器教程(转steam指南)
  7. CentOS 7.8使用devtoolset-9使用高版本gcc version 9.3.1
  8. Redis-字典(hash)基础
  9. 【loj2585】【APIO2018】新家
  10. linux解挂文件磁盘的命令,Linux学习笔记(4)磁盘分区(fdisk)、挂载与文件系统命令...
  11. 我第一次面试自动化测试就被diss了,人生惨遭滑铁卢…
  12. LISP 冻结excel窗格_Excel这10个实操技巧,每个都很牛逼,绝对不能错过
  13. linux wget无法下载文件,wget下载文件
  14. win7旗舰版和纯净版系统哪个好
  15. Spring注解注入原理
  16. Halcon图像拼接-算法速度优化
  17. “销售方法”一个让大多数人撑握不正确的问题!
  18. BeiJing2006 狼抓兔子
  19. iOS - 音频后台播放设置及锁屏界面的显示与控制
  20. xRM 扩展性及产品组合

热门文章

  1. mybatis学习(22):查询排序
  2. 65 modol1用户登录
  3. 贪心算法(leetcode分类解题,C++代码详细注释)
  4. php 对象 数量,php – Symfony2 / Doctrine如何在实体中存储相关对象的数量
  5. 做系统ghost步骤图解_用好这工具,小孩都能会重装系统!
  6. Golang 垃圾回收机制
  7. cocos2d-x 2.2 创建项目
  8. ※交换排序(1)——快速排序(quick sort)
  9. Django Python MySQL Linux 开发环境搭建
  10. 【开源】.net 分布式架构之监控平台