Skip to main content
BRILLIQS

Anaconda

A Python distribution and package manager that installs libraries along with the compiled components they depend on.

Anaconda is a distribution for Python and R aimed at scientific and data work. It bundles a large set of libraries with an installer, and provides a package manager that installs not only Python packages but the compiled libraries beneath them. Environments keep the packages for different projects separate.

The problem Anaconda addresses

Installing scientific Python libraries used to be genuinely difficult, and understanding why explains the whole distribution.

Many of these libraries are not pure Python. Underneath they use components written in C or Fortran, for numerical routines and linear algebra. Installing the Python package therefore requires those components to be present and compatible.

With a package manager that only understands Python packages, the compiled parts have to arrive some other way: compiled from source with the right toolchain, or installed separately in the right versions. On a machine without a working compiler, that fails in ways whose error messages are not informative.

Packaging what is underneath

Anaconda's package manager installs those compiled components as packages too.

Requesting a numerical library brings not only the Python package but the compiled pieces it depends on, in versions known to work together.

The result is that installations which were a project become a command. For anyone who has spent an afternoon trying to build a scientific library from source, that is the whole value proposition.

Environments

The second capability is isolation.

Different projects need different versions. One needs an older library because it depends on behaviour that changed; another needs the newest for a feature. Installed into one shared place, those requirements conflict and satisfying one breaks the other.

An environment is an isolated set of packages. Each project has its own, and they do not interfere.

This also protects the base installation. Experimenting in a throwaway environment cannot break anything you rely on, which makes trying an unfamiliar library a low risk act rather than a gamble.

Reproducing an environment

An environment can be described in a file listing its packages and versions, and recreated from that description elsewhere.

That is what makes analysis transferable. A colleague recreates your environment and runs your code, and the result is the same. Without it, running somebody else's analysis means discovering their package versions by trial and error.

For work that has to be reproducible months later, this matters as much as the code itself.

The bundled distribution

The installer provides Python along with a large set of commonly used libraries already present.

That suits somebody starting out, where installing a dozen libraries individually is an obstacle before any work begins. It also means the installation is large, and a minimal alternative exists for people who would rather add only what they need.

Who uses Anaconda

Anaconda is used in scientific computing, research and data science, particularly where compiled numerical libraries are involved and where environments have to be reproduced across machines.

Points to consider

Licensing has changed over time and depends on the organisation and how the distribution and its package channels are used. The official documentation is the authoritative reference, and it is worth checking for commercial use rather than assuming.

The full distribution is large, and where only a few packages are needed a minimal installer is the more sensible starting point.

Mixing package managers within one environment can also produce inconsistent states, and the documentation covers how to combine them where that is necessary.

Getting started

The documentation covers installing the distribution, creating and activating environments, installing packages and exporting an environment description. Creating a separate environment for one project, rather than installing into the base, is the habit worth forming immediately.

Key features of Anaconda

Capabilities described in the official documentation.

A package manager for more than Python

Compiled libraries that Python packages depend on are installed as packages too, rather than separately.

Isolated environments

Each project has its own environment, so one project's package versions do not affect another's.

A bundled distribution

An installer provides Python along with a large set of commonly used scientific libraries already present.

Support for R alongside Python

The same package manager and environments cover R packages as well as Python ones.

Advantages of Anaconda

Factual advantages that follow from the features above.

Difficult installations become routine

Because compiled dependencies are packaged, libraries that are awkward to build install like any other.

Projects do not interfere

Separate environments mean upgrading a package for one project cannot break another.

Environments can be reproduced

An environment can be described in a file and recreated elsewhere, so a setup transfers between machines.

Less setup before work starts

A bundled distribution means the common scientific libraries are present without being installed one at a time.

Common use cases for Anaconda

Situations the official documentation describes this tool as being used for.

Research

Setting up a scientific Python environment

An installation provides Python and the common libraries without each being installed individually.

Data science

Keeping project dependencies separate

Each project gets an environment so version requirements do not conflict between them.

Collaboration

Reproducing a colleague's setup

An environment description recreates the same package versions on another machine.

Scientific computing

Installing a library with compiled parts

A package needing compiled components installs through the package manager rather than being built by hand.

Official website

Everything on this page is based on the official documentation for Anaconda. You can read the source here.

Anaconda official documentation

Frequently asked questions about Anaconda

Answers taken from the official documentation for this tool.

It installs compiled libraries as well as Python packages. Many scientific libraries depend on components written in other languages, and packaging those too is what makes difficult installations routine.

Because analysis depends on package versions. An environment described in a file can be recreated on another machine, which is what allows a colleague to run your work and get the same result.

An isolated set of installed packages. Each project has its own, so one project can use one version of a library and another a different version, without conflict.

Licensing has changed over time and depends on the organisation and how the distribution and package channels are used. The official documentation is the authoritative source and should be checked for commercial use.