Yusuf_Kaba
Yusuf_Kaba

Reputation: 11

Should `conda` be installed in every environment?

I'm running Miniconda and have a question regarding conda update conda.

In this thread, some answer is (and that's what works) that conda needs to be updated in the base environment. However, it is possible to also install conda in a custom environment and then run conda update conda. My questions are:

Reason behind: I want to use a software called brightway2. In the manual it says:

"To upgrade Brightway2, do the following: First, make sure your background packages are up to date. In anaconda/miniconda, use the following commands (once you have activated your environment):

conda update conda
conda update -c conda-forge -c cmutel -c haasad brightway2 bw2data bw2io bw2calc bw2analyzer

I'm stumbling upon the "(once you have activated your environment)", which is not possible with updating conda in the base environment.

Upvotes: 1

Views: 1597

Answers (1)

darthbith
darthbith

Reputation: 19597

You should only have conda installed in the base environment (unfortunately, I don't have a reference for this :-().

In the most common case, the conda command is defined as a shell function in your login profile (usually ~/.bashrc or ~/.zshrc on macOS/Linux, I'm not sure about Windows). This is accomplished when you run conda init. Since it is defined as a shell function, it will be available no matter which environments are activated, or even if no environments are activated!

If you want to update a package in a specific environment, you can use the --name/-n flag to tell conda which environment to use:

conda update --name base conda

That will work no matter which environment is activated.

Upvotes: 1

Related Questions