The difference between Anaconda and conda, pip and conda

Conda, released in 2012, is an open source, cross-platform package and environment management tool.

1. The difference between Conda and Anaconda

Although Conda is packaged within Anaconda, the two are different things with different goals.

Conda and Anaconda are often confused, probably because Conda is tightly packaged into Anaconda and Miniconda.

Anaconda is a software distribution. A software distribution is a collection of pre-built and configured packages that can be installed on an operating system and used. Anaconda is developed by Anaconda Company, a complete distribution containing the core software in the PyData ecosystem. It includes Python itself and binaries of hundreds of third-party open source projects, such as conda, numpy, scipy, ipython, etc.

Miniconda is also a software distribution. Miniconda is essentially an installer used to install an empty conda environment. It only contains Conda and Conda's dependencies, but does not include the packages listed in the previous paragraph. So we can start from scratch and install what we need. Of course, we can also install anaconda into it through conda intall anaconda.

Conda is a package and environment management tool. A package management tool is a tool used to automate the installation, upgrade, and deletion of packages. Since Conda has subcommands such as "conda install", "conda update", and "conda remove", it fully meets the definition of a package management tool.

Note: If you wish, we can install Conda completely independently, without Anaconda and Miniconda.

2. The difference between Conda and Pip

Conda is a language-agnostic, cross-platform package and environment manager. Although conda originated from Python's PyData community, it is not only suitable for managing Python packages, but is also a general package management tool. Conda can be used to create and manage packages and dependencies of any type written in any language. It's much like a cross-platform version of apt or yum.

Conda can only install packages in the conda environment, but it can install packages in various languages ​​and types.

So, if we want to install Python packages in an existing system Python environment, conda cannot help us, because it can only install packages in the conda environment.

Pip is a universal manager for Python packages. The full name of pip is P ip  Install Packages , which is an officially certified package management tool for Python It can only manage python packages and is usually used to install packages published on the Python Package Index (PyPI). Both Pip and PyPI are managed and supported by the Python Packaging Authority (PyPA).

Pip can install packages in any environment, but it can only install Python packages.

So, if we need to use many Python packages that depend on external dependencies (such as NumPy, SciPy and Matplotlib), or if we want to track the external dependencies of these packages, then pip cannot help us because it can only manage Python package.

If all we want to do is install Python packages in independent environments, then the role of conda is almost the same as that of pip+virtualenv. The "independent environment" refers to the conda environment or virtualenv. In such an environment, we can install various packages without modifying the system Python installation.

The following is a comparison of the features of conda and pip:

conda pip
manage binary wheel or source code
Compiler required No Yes
language Any Python
virtual environment support Support via virtualenv or venv etc.
Dependency check Yes The screen prompts the user to select
Package source Anaconda repo和Cloud PyPI

3. The difference between Conda and pip+virtualenv

As mentioned earlier, if all we want to do is install Python packages in independent environments, then the function of conda is almost the same as that of pip+virtualenv.

But there are still some differences between the two.

First of all, in the conda environment, we can manage different versions of Python, including installing and upgrading Python itself. But virtualenvs must be based on an existing, externally managed Python executable. What virtualenv can achieve is that python packages in different environments are independent of each other, but the python used in different environments is the same version.

Second, conda can track non-Python dependencies, such as managing dependencies seamlessly, or is a parallel version of basic tools like LAPACK or OpenSSL.

Again, the conda environment is a truly independent environment placed in an executable path. The environment of virtualenv is based on symbolic links (symlinks). This environment breaks the independence of virtualenv and is sometimes very fragile for non-Python dependencies.

Finally, we can run conda install pip, and then we can use pip install to install the python package in the conda environment. However, we'd better not install conda in virtualenv, otherwise some strange problems may occur.

4. Relationship between Conda and Anaconda Company

Conda has no dependency or binding relationship with Anaconda. It is 100% open source, it is hosted on GitHub under BSD-License. However, conda's default channel is not completely open source, and there are probably dozens of packages that are not open source.

An important service of Anaconda is to provide free hosting services for build artifacts. However, if you are worried about Anaconda's future charges, we do not have to use Anaconda's hosting services.

There is currently a community-sponsored, community-led effort launched in 2016 called Conda-Forge . It makes conda packaging and distribution completely open source. All packages are hosted on Github, and binaries are automatically created using free CI tools (e.g. Travis CI on Mac, AppVeyor on Windows, CircleCI on Linux). All metadata of each package is stored in the Github repository, and package upgrades are completed through merge GitHub pull requests.

Conda-Forge also publishes its packages to https://anaconda.org/ .

It is worth mentioning that the conda package is hosted by the for-profit company Anaconda Corporation. Likewise, the Python Package Index is hosted by the for-profit company Packspace.

 

Guess you like

Origin blog.csdn.net/HideInTime/article/details/123925490