1

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:

  • Do I need to install conda in each new environment or is it "passed through" somehow from the base environment?
  • If I do install conda in a new environment, do I have to update it manually, or will it always be the same version as in base?

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.

merv
  • 67,214
  • 13
  • 180
  • 245
Yusuf_Kaba
  • 11
  • 2

1 Answers1

1

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.

darthbith
  • 18,484
  • 9
  • 60
  • 76
  • Thank you for the quick response. Since I should have conda installed only in the base environment, I wonder what happens when I install conda in other environments additionally. – Yusuf_Kaba Mar 25 '22 at 22:21
  • I don't recall precisely what will happen, and actually, I've never tested it :-) – darthbith Mar 26 '22 at 13:30