What is the difference between pip and conda?

后端 未结 12 1068
名媛妹妹
名媛妹妹 2020-11-22 08:27

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

Ca

12条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 08:58

    Here is a short rundown:

    pip

    • Python packages only.
    • Compiles everything from source. EDIT: pip now installs binary wheels, if they are available.
    • Blessed by the core Python community (i.e., Python 3.4+ includes code that automatically bootstraps pip).

    conda

    • Python agnostic. The main focus of existing packages are for Python, and indeed Conda itself is written in Python, but you can also have Conda packages for C libraries, or R packages, or really anything.
    • Installs binaries. There is a tool called conda build that builds packages from source, but conda install itself installs things from already built Conda packages.
    • External. Conda is the package manager of Anaconda, the Python distribution provided by Continuum Analytics, but it can be used outside of Anaconda too. You can use it with an existing Python installation by pip installing it (though this is not recommended unless you have a good reason to use an existing installation).

    In both cases:

    • Written in Python
    • Open source (Conda is BSD and pip is MIT)

    The first two bullet points of Conda are really what make it advantageous over pip for many packages. Since pip installs from source, it can be painful to install things with it if you are unable to compile the source code (this is especially true on Windows, but it can even be true on Linux if the packages have some difficult C or FORTRAN library dependencies). Conda installs from binary, meaning that someone (e.g., Continuum) has already done the hard work of compiling the package, and so the installation is easy.

    There are also some differences if you are interested in building your own packages. For instance, pip is built on top of setuptools, whereas Conda uses its own format, which has some advantages (like being static, and again, Python agnostic).

提交回复
热议问题