JobHunter69
JobHunter69

Reputation: 2290

What's the purpose of the "base" (for best practices) in Anaconda?

It says it's a default environment but "You don't want to put programs into your base environment, though"

So what exactly should I use it for? Do other environments I create inherit from the base?

Upvotes: 19

Views: 15124

Answers (1)

Roland Weber
Roland Weber

Reputation: 3675

The base environment is where conda itself gets installed. It's best to use Miniconda, and install all the things you want into separate environments.

Other environments do not inherit packages from the base environment. BUT the bin/ directory of the base environment is in the search path for executables. So if you call conda from inside any of your environments (which usually don't have conda installed), the one from the base environment is used.

If you install other executables into the base environment, they can be called from your other environments. But you'll have a hell of a tough time to distinguish whether the things you can call are actually in your environment, or in the base environment.
Therefore, it's best to just have conda in the base environment. And maybe other generic tools, like git or make, if you install that kind of tool with conda. But packages that are imported by your Python/R/whatever code do not belong into the base environment.

Don't worry about disk space if you create multiple environments with the same packages. conda does a very good job with hard-linking the same packages into multiple environments to save space.

The full Anaconda installer puts a ton of stuff into the base environment. That might seem convenient at first, but when you start creating new environments, you'll run into the problem I mentioned. You can call stuff from your new environment although it isn't installed there. Using Miniconda avoids this, at the cost of having to create a new environment before actually being able to use stuff. However, there's an anaconda meta-package which you can install to get the "ton of stuff" with one command.

Upvotes: 28

Related Questions