Conda update anaconda

When spyder starts up, and there is a new version available, it says to run conda update anaconda before updating spyder itself. But this gives me a PackageNotInstalledError.
After looking through my file directory, I see an anaconda in /home/anaconda3/bin.
When I conda update --prefix /home/erik/anaconda3/bin anaconda I get DirectoryNotACondaEnvironmentError.

When I conda update --prefix /home/anaconda3 anaconda I get EnvironmentLocationNotFound: Not a conda environment: /home/anaconda3.
I have a few virtual environments, plus the base environment.
conda list from the base environment shows anaconda-client and anaconda-navigator, but no plain anaconda or anaconda3.
conda update --all works fine.
conda update *any other installed package* works fine too.
Is the message in the spyder pop-up just misleading then?

The error message ā€˜DirectoryNotACondaEnvrionmentErrorā€™ is correct in this case.
The directory ā€˜/home/erik/anaconda3/binā€™ is just where the ananconda executable lives.

You can type the command:
conda env list

to list all available conda environments.

The conda environments themselves will be located in the directory ā€˜/home/anaconda3/envsā€™ on your system.

I hope this helps.

On my windows machine, conda update anaconda works just fine. How come it doesnā€™t on my linux machine? I wonder what the difference is. -Erik

Can you attach the output from running the ā€˜conda update anancondaā€™ command below on your linux machine?
What version of conda are you running?

You can determine that by typing:
conda info

(base) erik@pop-os:~$ conda info

     active environment : base
    active env location : /home/erik/anaconda3
            shell level : 1
       user config file : /home/erik/.condarc
 populated config files : /home/erik/.condarc
          conda version : 22.9.0
    conda-build version : 3.21.4
         python version : 3.8.13.final.0
       virtual packages : __linux=5.19.16=0
                          __glibc=2.35=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/erik/anaconda3  (writable)
      conda av data dir : /home/erik/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/erik/anaconda3/pkgs
                          /home/erik/.conda/pkgs
       envs directories : /home/erik/anaconda3/envs
                          /home/erik/.conda/envs
               platform : linux-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.8.13 Linux/5.19.16-76051916-generic pop/22.04 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

and the output of conda update anaconda is

(base) erik@pop-os:~$ conda info

     active environment : base
    active env location : /home/erik/anaconda3
            shell level : 1
       user config file : /home/erik/.condarc
 populated config files : /home/erik/.condarc
          conda version : 22.9.0
    conda-build version : 3.21.4
         python version : 3.8.13.final.0
       virtual packages : __linux=5.19.16=0
                          __glibc=2.35=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/erik/anaconda3  (writable)
      conda av data dir : /home/erik/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/erik/anaconda3/pkgs
                          /home/erik/.conda/pkgs
       envs directories : /home/erik/anaconda3/envs
                          /home/erik/.conda/envs
               platform : linux-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.8.13 Linux/5.19.16-76051916-generic pop/22.04 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

whether or not I have my base environment activated.

What is the architecture of your version of Linux?
Are you running on linux-64 or linux-32(32-bit)?

If you are running on linux-32, there wonā€™t be any anaconda package to update, as it hasnā€™t been updated in awhileā€¦

Woops, I didnā€™t actually post the output of conda update anaconda:

(kivyenv) erik@pop-os:~/GitRepos/KivyPractice/gridandlabel$ conda update anaconda

PackageNotInstalledError: Package is not installed in prefix.
  prefix: /home/erik/anaconda3/envs/kivyenv
  package name: anaconda

And yes, Iā€™m on 64 bit linux, which I think can be inferred from conda info, above.

I have the same issue with latest Version of Anaconda for Windows fresh instralled today:

conda update anaconda

PackageNotInstalledError: Package is not installed in prefix.
  prefix: C:\Users\schne\AppData\Local\anaconda3
  package name: anaconda

conda info

     active environment : base
    active env location : C:\Users\schne\AppData\Local\anaconda3
            shell level : 1
       user config file : C:\Users\schne\.condarc
populated config files : C:\Users\schne\.condarc
          conda version : 24.3.0
    conda-build version : 24.1.2
         python version : 3.11.7.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=skylake
                          __conda=24.3.0=0
                          __cuda=12.2=0
                          __win=0=0
       base environment : C:\Users\schne\AppData\Local\anaconda3  (writable)
      conda av data dir : C:\Users\schne\AppData\Local\anaconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/microsoft/win-64
                          https://conda.anaconda.org/microsoft/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\schne\AppData\Local\anaconda3\pkgs
                          C:\Users\schne\.conda\pkgs
                          C:\Users\schne\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\schne\AppData\Local\anaconda3\envs
                          C:\Users\schne\.conda\envs
                          C:\Users\schne\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.11.7 Windows/10 Windows/10.0.19045 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.6 aau/0.4.3 c/eL4GtcbnLQIUYnRCg8ncxw s/iYGTaq7GMAmK5X-Wc78GKQ e/ZQJaLM2q4bt9-ysEd5Bhqw
          administrator : False
             netrc file : None
           offline mode : False

Any idea how to fix it?

I have the same issue with Anaconda 2024.02-1 for Windows x86_64 fresh instralled today:

conda update anaconda

PackageNotInstalledError: Package is not installed in prefix.
  prefix: C:\Users\Oleg\anaconda3
  package name: anaconda

conda info


     active environment : base
    active env location : C:\Users\Oleg\anaconda3
            shell level : 1
       user config file : C:\Users\Oleg\.condarc
 populated config files : C:\Users\Oleg\.condarc
          conda version : 24.3.0
    conda-build version : 24.1.2
         python version : 3.11.7.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=haswell
                          __conda=24.3.0=0
                          __cuda=9.1=0
                          __win=0=0
       base environment : C:\Users\Oleg\anaconda3  (writable)
      conda av data dir : C:\Users\Oleg\anaconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\Oleg\anaconda3\pkgs
                          C:\Users\Oleg\.conda\pkgs
                          C:\Users\Oleg\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\Oleg\anaconda3\envs
                          C:\Users\Oleg\.conda\envs
                          C:\Users\Oleg\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.11.7 Windows/10 Windows/10.0.19045 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.6 aau/0.4.3 c/QtcbgipokN472ozzlimtTg s/Tu0xYmsVOo3keNisfN0ZyA e/PtYPIZoYjZDJFmDxI89PMg
          administrator : False
             netrc file : None
           offline mode : False

i have the same problem. From the base environment I did conda update conda sucessfully, but conda update anaconda gives an error. Is there a solution?

(base) C:\Users\jdcar>conda update anaconda

PackageNotInstalledError: Package is not installed in prefix.
prefix: C:\Users\jdcar\anaconda3
package name: anaconda

Is the anaconda metapackage installed into the environment where you are attempting to update it? In other words, if you use the conda list command, is anaconda one of the packages listed under the Name column?
What happens when you try
conda install anaconda

for reference: Updating conda and Anaconda ā€” Anaconda documentation

Hi Crystal, thank you for taking a look on this issue.

I have this issue in base environment right after Anaconda installation.

There is no anaconda in the conda list output:

(base) C:\Users\Oleg>conda list
# packages in environment at C:\Users\Oleg\anaconda3:
#
# Name                    Version                   Build  Channel
_anaconda_depends         2024.02             py311_mkl_1
abseil-cpp                20211102.0           hd77b12b_0
aiobotocore               2.7.0           py311haa95532_0
aiohttp                   3.9.3           py311h2bbff1b_0
aioitertools              0.7.1              pyhd3eb1b0_0
aiosignal                 1.2.0              pyhd3eb1b0_0
alabaster                 0.7.12             pyhd3eb1b0_0
altair                    5.0.1           py311haa95532_0
anaconda-anon-usage       0.4.3           py311hfc23b7f_100
anaconda-catalogs         0.2.0           py311haa95532_0
anaconda-client           1.12.3          py311haa95532_0
anaconda-cloud-auth       0.1.4           py311haa95532_0
anaconda-navigator        2.5.4           py311haa95532_1
anaconda-project          0.11.1          py311haa95532_0
anyio                     4.2.0           py311haa95532_0
aom                       3.6.0                hd77b12b_0
appdirs                   1.4.4              pyhd3eb1b0_0
archspec                  0.2.3              pyhd3eb1b0_0
argon2-cffi               21.3.0             pyhd3eb1b0_0
argon2-cffi-bindings      21.2.0          py311h2bbff1b_0
arrow                     1.2.3           py311haa95532_1
arrow-cpp                 14.0.2               ha81ea56_1
astroid                   2.14.2          py311haa95532_0
astropy                   5.3.4           py311hd7041d2_0
asttokens                 2.0.5              pyhd3eb1b0_0
async-lru                 2.0.4           py311haa95532_0
atomicwrites              1.4.0                      py_0
attrs                     23.1.0          py311haa95532_0
automat                   20.2.0                     py_0
autopep8                  1.6.0              pyhd3eb1b0_1
aws-c-auth                0.6.19               h2bbff1b_0
aws-c-cal                 0.5.20               h2bbff1b_0
aws-c-common              0.8.5                h2bbff1b_0
aws-c-compression         0.2.16               h2bbff1b_0
aws-c-event-stream        0.2.15               hd77b12b_0
aws-c-http                0.6.25               h2bbff1b_0
aws-c-io                  0.13.10              h2bbff1b_0
aws-c-mqtt                0.7.13               h2bbff1b_0
aws-c-s3                  0.1.51               h2bbff1b_0
aws-c-sdkutils            0.1.6                h2bbff1b_0
aws-checksums             0.1.13               h2bbff1b_0
aws-crt-cpp               0.18.16              hd77b12b_0
aws-sdk-cpp               1.10.55              hd77b12b_0
babel                     2.11.0          py311haa95532_0
...
truncated

The output of conda install anaconda follows below:

(base) C:\Users\Oleg>conda install anaconda
Channels:
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\Oleg\anaconda3

  added / updated specs:
    - anaconda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    anaconda-2024.02           |      py311_mkl_1          76 KB
    ca-certificates-2023.12.12 |       haa95532_0         127 KB
    openssl-3.0.13             |       h2bbff1b_0         7.4 MB
    ------------------------------------------------------------
                                           Total:         7.6 MB

The following NEW packages will be INSTALLED:

  anaconda           pkgs/main/win-64::anaconda-2024.02-py311_mkl_1

The following packages will be DOWNGRADED:

  ca-certificates                      2024.3.11-haa95532_0 --> 2023.12.12-haa95532_0
  openssl                                 3.0.13-h2bbff1b_1 --> 3.0.13-h2bbff1b_0


Proceed ([y]/n)?

It looks a bit strange that installation of anaconda wants to downgrade 2 important packages which there updated recently by running conda update conda.

Hope that helps.

The anaconda metapackage pins the versions to each installer release. Looks like you have a few packages that are newer than when the last release came out in February of this year. In other words, this is working as expected. If the anaconda metapackage isnā€™t installed, you will get that message you highlighted originally when you attempt to update it - that is also working as expected.
What was your goal with running conda update anaconda? To update the packages in your environment to the latest?

1 Like

The problem I see here is that the anaconda meta package is not installed at all after fresh installation. Could we address this issue, please?

Excluding the anaconda metapackage itself from the Anaconda Distribution installer was an intentional change that happened in Feb 2023. In general, it is best practice to have your working environment not be your base environment - so Iā€™d recommend creating a new environment with the anaconda metapackage installed.

conda create -n myenv anaconda
conda activate myenv
conda update anaconda

Alternatively, you could try using conda update --all to update the packages in your current environment - but I would recommend not doing this in your base environment, because if something ever goes wrong with the base installation, it means you need to reinstall everything.

Hi Crystal!

Thanks a lot for exhaustive answer.

So the observed absence of anaconda metapackage in the base environment is an expected change in behavior which occurred more than a year ago. Thanks for getting this clear, that was mine main concern.

At this point I got somewhat confused, let me share my thoughts with you.

I use base environment. Running conda update conda I can update it.

Running conda update anaconda I get an error about anaconda metapackahe was not installed. That make sense now as the metapackage was not installed by default since Feb 2023. Same time Updating conda and Anaconda ā€” Anaconda documentation still suggest:

To update to the latest version of Anaconda, enter these commands:

conda update -n base conda
conda update -n base anaconda

e.g. the presence of installed metapackage anaconda in base environment is explicitly expected. I feel I am missing somethin at this point: the documentation suggests one thing, but the reality is quite different.

If I try to install anaconda metapackage in base environment I get offered to:

  1. Install metapackage anaconda
  2. Downgrade ca-certificates package (it was recently upgraded with conda update conda)
  3. Downgrade openssl package (it was recently upgraded with conda update conda too).

At this point I assume that installation of anaconda metapackage do not add anything to base environment, but tries to downgrade 2 packages which conda package has recently updated. So I begun to question what for anaconda metapackage is if it do not add anything to base environment? And why anaconda metapackage tries to downgrade packages upgraded by conda package? It looks like some desynchronization between these 2 packages. So far I see no any need to install anaconda metapackage as it do not add new packages to base environment.

Hope I was clear to express my concerns.

Yes - I see your concerns and confusion. We should update that documentation page to reflect the current recommendations. Thank you for highlighting that.
At the current moment, there is probably not a huge advantage for you to have the anaconda metapackage installed as you have a pretty recent installation of the Anaconda Distribution. After the next release, with it, you can use it to easily update all the anaconda packages to the version shipped in the next installer - without having to download a new installer, etc. The specific versions of the anaconda metapackage have the packages pinned to the versions included in the installer. In other words, version 2024.02 of the anaconda metapackage has the versions of the packages pinned to the specific versions included in the installer released in February of this year.
If you have the ā€œcustomā€ version of the anaconda metapackage installed, it should allow you to get the latest version of all the packages in the metapackage.
In other words, above, I should have asked what happens when you try conda install anaconda=custom
So as time goes on, it will be more useful - as it will allow many updates at once, instead of having to update each package individually. The team is regularly adding new package updates to the repo.anaconda.com.

Hi Crystal,

Thanks for the support thus far. I have arrived at exactly the same situation as Oleg with my fresh install, and this happened for the same reason as it did for Hans originally - trying to update Spyder. I understand what you have explained but have several questions that follow on.

[1]
Based on the Spyder instructions, I had attempted to first update Anaconda via:
(base) > conda update conda
(base) > conda update anaconda
And as discussed above, only the first command worked which updated two packages: ca-certificates and openssl. I guess you would recommend downgrading those two packages in my base environment back to the pinned versions of the Anaconda release.

Question: Iā€™m guessing to do this, I should run:
(base) > conda install anaconda
When I do that it suggests it will not only downgrade ca-certificates and openssl, but also install NEW anaconda 2024.02-py311_mkl_1. I guess this is ok, as it is telling us that Anaconda will be installed but that nothing will actually happen except two packages will be downgraded. And as I can confirm the operation completes in a few seconds.

[2]
When a new Anaconda release becomes available, given that the old instructions are no longer correct (update conda, update anaconda)ā€¦

Question: what should I do to update my base environment? Perhaps it is just as above?
(base) > conda install anaconda

[3]
The current Anaconda release includes Spyder 5.4.3. Lets say I create a new environment myenv using the current Anaconda release, and then update Spyder there:
(base) > conda create --name myenv --clone base
(base) > conda activate myenv
(myenv) > conda install spyder=5.5.1
Obviously multiple packages will have their version changed. Then lets say that later a new Anaconda release appears which still uses Spyder 5.4.3.

Question: I can update my base environment without issue Iā€™m sure but to also keep running Spyder 5.5.1 in myenv would I run the following?
(base) > conda install anaconda
(base) > conda activate myenv
(myenv) > conda install anaconda
(myenv) > conda install spyder=5.5.1

Your time is greatly appreciated here!

Many thanks,
Darren.

Iā€™d actually recommend creating a new environment and working out of there. If something gets messed up with base it means reinstalling - if something gets messed up with a separate environment, you can just create a new one without having to reinstall. It is good to keep conda up to date in your base environment though (conda update conda).

So, Iā€™d suggest

conda create -n myenv anaconda=custom 
conda activate myenv
spyder

This will get you an environment with the latest versions of the packages included in the Anaconda installer (including Spyder 5.5.1). The last step launches Spyder from your myenv environment.
As time passes, conda update anaconda will also work as you expect in this environment and should update Spyder to the latest.

Hope that helps!

1 Like

Crystal, thank you for explaining this in more detail. Iā€™m on older programmer but new to python. And your response was very helpful to me in understanding what the error is actually saying. Iā€™m still trying to get the hang of this package management.