Problem Updating Conda/Anaconda

Hello,

I’m using Conda/Anaconda on Mac (latest OS) with the command line (zsh). Apologies, I’m fairly new to it all. I’m trying to keep everything up to date. What’d be the commands to do that?

This is what I found and understand:
Conda is the package manager; Anaconda is the distribution/repository of packages.

conda update anaconda # Updates Anaconda distrib itself & package manager.
conda update --all # Updates all packages in current active env; doesn't update Anaconda distribution.

As I understand it, conda update conda updates the Conda package manager, but is usually not required, as conda update anaconda typically updates both the Anaconda distribution and Conda package manager. Is this all correct so far?

My problem:
Since I installed Conda/Anaconda, I’ve had no problem running the following weekly to keep everything up to date:

conda update anaconda
conda update --all

But, today, I got this error:

cpenning@IC-HV4FFK3XL1 ~ % conda activate                
(base) cpenning@IC-HV4FFK3XL1 ~ % conda update anaconda      

PackageNotInstalledError: Package is not installed in prefix.
  prefix: /Users/cpenning/anaconda3
  package name: anaconda

I haven’t knowingly changed anything to cause this error. What’s the problem? I haven’t got any clarity by googling the error.

I definitely have Anaconda installed and the following runs fine:

(base) cpenning@IC-HV4FFK3XL1 ~ % conda --version            
conda 23.7.4
(base) cpenning@IC-HV4FFK3XL1 ~ % conda update conda
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

(base) cpenning@IC-HV4FFK3XL1 ~ % conda update --all
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

I’d be very grateful for help, please. Thank you.

Hello,

‘anaconda’; is a separate package from ‘conda’.

Try this:

‘conda install anaconda’ from your conda environment - then you should be able to run:

conda update --all
1 Like

I’m having the same issue. I just installed the latest Anaconda distro for Mac-Intel on my iMac running macOS Sonoma. I then wanted to make sure that everything was up to date, so I typed:

conda update conda

followed by:

conda update anaconda

which rendered the following error:

PackageNotInstalledError: Package is not installed in prefix.
  prefix: /Users/odebroqueville/anaconda3
  package name: anaconda

I’ve barely done anything and really just wanted Python to be updated to 3.12.0 and I’m already getting an error!

I then followed the instruction above (which doesn’t explain what it does, so I’m just guessing that it overwrites the current anaconda install) and typed:

conda install anaconda

but when I saw that it wants to install:

The following NEW packages will be INSTALLED:

  anaconda           pkgs/main/osx-64::anaconda-custom-py311_2

I didn’t proceed because it looks like it would install Python 3.11.2 whilst I already have Python 3.11.5!

Maybe I shouldn’t have updated conda but it’s one of the recommendations to keep conda updated!

Not sure what I should do now!

Hello Oliver,

To install python 3.12 you would need to create a new environment with the command conda create -n <name> activate it with the command conda activate <name> and then install python 3.12.

The version of python in base environment is not upgradable, it is the one who ships with our installer and we still haven’t released an installer with python 3.12 baked. Our latest version of installer is python 3.11.5 if I’m not mistaken.

So for you to use python 3.12 you do need to use it in a custom environment and not in the base enviroment. Also, it is best practice to leave base env untouched and just create as many custom environments you want.

Hope this helps

Hello Joaquim,

Thank you for your answer. Just wondering…

Are conda and anaconda installed in the base environment only, or can they be updated in a specific environment? I understand that the following lines update conda and anaconda in the base environment, but how would you update them in another env?

conda update conda

conda update anaconda

thanks, this worked for me and resolved the same issue.