ChatGPT解决这个技术问题 Extra ChatGPT

How do I update Anaconda?

I have Anaconda installed on my computer and I'd like to update it. In Navigator I can see that there are several individual packages that can be updated, but also an anaconda package that sometimes has a version number and sometimes says custom. How do I proceed?

https://i.stack.imgur.com/YZraz.png

Most answers suggest conda update [-n root] -v anaconda, but it's offering to DOWNGRADE my python: 3.7.0-hc167b69_0 --> 3.6.6-hc167b69_0. Seems very broken.

V
VimNing

root is the old (pre-conda 4.4) name for the main environment; after conda 4.4, it was renamed to be base. source

What 95% of people actually want

In most cases what you want to do when you say that you want to update Anaconda is to execute the command:

conda update --all

(But this should be preceded by conda update -n base conda so you have the latest conda version installed)

This will update all packages in the current environment to the latest version -- with the small print being that it may use an older version of some packages in order to satisfy dependency constraints (often this won't be necessary and when it is necessary the package plan solver will do its best to minimize the impact).

This needs to be executed from the command line, and the best way to get there is from Anaconda Navigator, then the "Environments" tab, then click on the triangle beside the base environment, selecting "Open Terminal":

https://i.stack.imgur.com/6JjBC.png

This operation will only update the one selected environment (in this case, the base environment). If you have other environments you'd like to update you can repeat the process above, but first click on the environment. When it is selected there is a triangular marker on the right (see image above, step 3). Or from the command line you can provide the environment name (-n envname) or path (-p /path/to/env), for example to update your dspyr environment from the screenshot above:

conda update -n dspyr --all

Update individual packages

If you are only interested in updating an individual package then simply click on the blue arrow or blue version number in Navigator, e.g. for astroid or astropy in the screenshot above, and this will tag those packages for an upgrade. When you are done you need to click the "Apply" button:

https://i.stack.imgur.com/wB5bx.png

Or from the command line:

conda update astroid astropy

Updating just the packages in the standard Anaconda Distribution

If you don't care about package versions and just want "the latest set of all packages in the standard Anaconda Distribution, so long as they work together", then you should take a look at this gist.

Why updating the Anaconda package is almost always a bad idea

In most cases updating the Anaconda package in the package list will have a surprising result: you may actually downgrade many packages (in fact, this is likely if it indicates the version as custom). The gist above provides details.

Leverage conda environments

Your base environment is probably not a good place to try and manage an exact set of packages: it is going to be a dynamic working space with new packages installed and packages randomly updated. If you need an exact set of packages then create a conda environment to hold them. Thanks to the conda package cache and the way file linking is used doing this is typically i) fast and ii) consumes very little additional disk space. E.g.

conda create -n myspecialenv -c bioconda -c conda-forge python=3.5 pandas beautifulsoup seaborn nltk

The conda documentation has more details and examples.

pip, PyPI, and setuptools?

None of this is going to help with updating packages that have been installed from PyPI via pip or any packages installed using python setup.py install. conda list will give you some hints about the pip-based Python packages you have in an environment, but it won't do anything special to update them.

Commercial use of Anaconda or Anaconda Enterprise

It is pretty much exactly the same story, with the exception that you may not be able to update the base environment if it was installed by someone else (say to /opt/anaconda/latest). If you're not able to update the environments you are using you should be able to clone and then update:

conda create -n myenv --clone base
conda update -n myenv --all

@MattSchmatt make sure you do conda update conda as well. Conda has evolved substantially in the past year, and in particular we had a release in late September 2017 that introduced a lot of improvements. If conda update --all breaks things (which, historically, it was almost certain to do) then this is a bug you should report to the conda GitHub issue tracker -- today that operation should not break any existing components (with the proviso conda needs to be up to date).
I had to do conda update -n root conda instead of what's mentioned above in order for it to work.
The conda update --all is not what 95% of peoples want. It can lead to unstable environment. Answer by user3056882 is safer.
conda update --all failed for me with a 'permission denied' error. Ran it with administrator privilege successfully. To run with Administrator privilege: Start > Anaconda3 > Anaconda Prompt > Right-click > More > Run As Administrator.
The spyder developers are saying the exact opposite of this: "In general it's not a good idea to use conda update --all" and here: "To perform the update with conda (strongly recommended), just run conda update anaconda then conda update spyder"
R
RafaelJan

If you are trying to update your Anaconda version to a new one, you'll notice that running the new installer wouldn't work, as it complains the installation directory is non-empty.

So you should use conda to upgrade as detailed by the official docs:

conda update conda
conda update anaconda

https://i.stack.imgur.com/d6RVb.png

This prevents the error:

ERROR conda.core.link:_execute(502): An error occurred while uninstalling package 'defaults::conda-4.5.4-py36_0'. PermissionError(13, 'Access is denied')


The link to the official docs that you give says that you need to update with conda update conda followed by conda install anaconda=VersionNumber, not with conda update anaconda. See the other answer of this same question. Or does it automatically install the most recent version if you leave out the VersionNumber, and is install = update?
Checked this. After updating with conda install anaconda=2021.05 (the most recent metapackage version available at the time of testing) I updated again with conda update anaconda of this answer. And the latter would install 13 new packages and update about 100 packages. Only anaconda itself gets "downgraded", but that is only called like this because it changes to a custom version: The following packages will be DOWNGRADED: anaconda 2021.05-py38_0 --> custom-py38_1. Therefore, conda update anaconda gives you the most recent package collection. conda install anaconda installs less.
g
gagarine

Open "command or conda prompt" and run:

conda update conda
conda update anaconda

It's a good idea to run both command twice (one after the other) to be sure that all the basic files are updated.

This should put you back on the latest 'releases', which contains packages that are selected by the people at Continuum to work well together.

If you want the last version of each package run (this can lead to an unstable environment):

conda update --all 

Hope this helps.

Sources:

https://docs.anaconda.com/anaconda/install/update-version

https://github.com/conda/conda/issues/1414#issuecomment-119071154


If you prefer a stable environment over having the latest version of every package, then skip step 4. conda update anaconda should put you back on one of the 'releases', which contains packages that are selected by the people at Continuum to work well together.
Thank you rudolfbyker. I've edited the answer to reflect your comment.
If you get package not installed error try conda install anaconda.
I update conda and then all my packages stopped working....I don't know why but it think your solution is not a good idea cuz conda is not stable using this way to upgrade.... here is a way to rolling back
The link to the official docs that you give says that you need to update with conda update conda followed by conda install anaconda=VersionNumber, not with conda update anaconda. See the other answer of this same question. Or does it automatically install the most recent version if you leave out the VersionNumber, and is install = update?
M
MattSchmatt

This is what the official Anaconda documentation recommends:

conda update conda
conda install anaconda=2021.11

You can find the current and past version codes here.

The command will update to a specific release of the Anaconda meta-package.

I feel like (contrary to the claim made in the accepted answer) this is more what 95% of Anaconda users want imho: Upgrading to the latest version of the Anaconda meta-package (put together and tested by the Anaconda Distributors) and ignoring the update status of individual packages, which would be issued by conda update --all.


Checked this. After updating with conda install anaconda=2021.05 (the most recent metapackage version available at the time of testing) I updated again with conda update anaconda of another answer. And the latter would install 13 new packages and update about 100 packages. Only anaconda itself gets "downgraded", but that is only called like this because it changes to a custom version: The following packages will be DOWNGRADED: anaconda 2021.05-py38_0 --> custom-py38_1. Therefore, conda update anaconda gives you the most recent (custom) collection.
This is the only answer that really sticks to the official guide of Updating from older versions if you do not want to use a custom version, but a release that you add like =version. If you need to find the latest release, you might also search in the available Anaconda versions and cut it at the release name: Anaconda3-2021.05-Windows-x86_64.exe becomes 2021.05. And the seemingly old 2021.05 is still the most recent release version in 09/2021, it can thus be some months old.
P
Peter Mortensen

Here's the best practice (in my humble experience). Selecting these four packages will also update all other dependencies to the appropriate versions that will help you keep your environment consistent. The latter is a common problem others have expressed in earlier responses. This solution doesn't need the terminal.

https://i.stack.imgur.com/K2TXu.png


P
Peter Mortensen

Open Anaconda cmd in base mode:

Then use conda update conda to update Anaconda.

You can then use conda update --all to update all the requirements for Anaconda:

conda update conda
conda update --all

I
InLaw

If you have trouble to get e.g. from 3.3.x to 4.x (conda update conda "does not work" to get to the next version) than try it more specific like so:

conda install conda=4.0 (or conda install anaconda=4.0)

https://www.anaconda.com/blog/developer-blog/anaconda-4-release/

You should know what you do, because conda could break due to the forced installation. If you would like to get more flexibility/security you could use pkg-manager like nix(-pkgs) [with nix-shell] / NixOS.


Perhaps, but wouldn't you consider that utterly broken, as a kludge?
Version "continuity" is a standard e.g. in (web)development. Like always, if you want to have everythink alined and re-evaluated you should rebuild all with the updated Versions. In general an "conda update --all" with updates ../conda/../pinned file should work proper as well (!take care of additional pip installations!).
When we manually have to tell the updater what specific version to update to, then it's no longer an updater, just a broken installer with a pretty GUI. In general conda update --all breaks everything, as their own FAQ says, and in my instance it cheerfully offers to downgrade my python from 3.7.0 to 3.6.6 (although it knows 3.7.1 is available)
That's your opinion about an installer but it is an STANDARD in IT (with some reason behind it). Again, it depends especially on your pinned file AND if you installed pkgs as well via PIP! Regarding you case: if you have pkgs which are not available or compatible with python 3.7.x THAN it will get the Python version with can optimal fit the restrictions of all the pkgs in your env. That's the reason that there is "conda".
What is your reason for using conda (if not for the integrity-check/downgrade you are complaining about)?
j
jialin

Yet, another answer:

conda update -n base conda -c anaconda

where -c your preferred channel or simply leave out.

copied from here


P
Peter Mortensen

I'm using Windows 10. The following updates everything and also installs some new packages, including a Python update (for me it was 3.7.3).

At the shell, try the following (be sure to change where your Anaconda 3 Data is installed). It takes some time to update everything.

conda update --prefix X:\XXXXData\Anaconda3 anaconda

P
Peter Mortensen

To update your installed version to the latest version, say 2019.07, run:

conda install anaconda=2019.07

In most cases, this method can meet your needs and avoid dependency problems.


q
questionto42standswithUkraine

Intro

This answer wraps up many answers and comments, it does not add new code, all credits go to the other answers, especially this answer that shows how to install the official release, fully in line with the docs.

In the following, the "docs" mean the official Anaconda documentation at Updating from older versions. It makes sense to read the docs, it is a short overview.

And since it will be used quite often, here is the definition of metapackage:

A metapackage is a very simple package that has at least a name and a version. It need not have any dependencies or build steps. Metapackages may list dependencies to several core, low-level libraries and may contain links to software files that are automatically downloaded when executed.

First step

As a first step before the anaconda install, you update conda:

conda update conda

Second step

As a second step, you have three choices: custom or official metapackage, or conda update --all.

1. Custom metapackage

If you are allowed to have the most recent custom metapackage (mind that this might not always be the best choice for standard packages with constrained dependencies), then you can use

conda install anaconda

Docs:

There is a special “custom” version of the Anaconda metapackage that has all the package dependencies, but none of them are constrained. The “custom” version is lower in version ordering than any actual release number.

The starting point for the tests was the installed release 2021.05. After this, conda update anaconda and conda install anaconda both lead to the same new "downgraded custom version" of custom-py38_1, see at the bottom of the code blocks: version change of anaconda = 2021.05-py38_0 --> custom-py38_1. But using update leads to far more installed packages than install here:

update leads to more installation steps than install

(base) C:\WINDOWS\system32>conda update anaconda
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\toeft\anaconda3

  added / updated specs:
    - anaconda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _anaconda_depends-2020.07  |           py38_0           6 KB
    anaconda-custom            |           py38_1          36 KB
    anaconda-client-1.8.0      |   py38haa95532_0         170 KB
    anaconda-project-0.10.1    |     pyhd3eb1b0_0         218 KB
    astroid-2.6.6              |   py38haa95532_0         314 KB
    astropy-4.3.1              |   py38hc7d831d_0         6.1 MB
    attrs-21.2.0               |     pyhd3eb1b0_0          46 KB
    babel-2.9.1                |     pyhd3eb1b0_0         5.5 MB
    ...
    xlsxwriter-3.0.1           |     pyhd3eb1b0_0         111 KB
    xlwings-0.24.7             |   py38haa95532_0         887 KB
    zeromq-4.3.4               |       hd77b12b_0         4.2 MB
    zipp-3.5.0                 |     pyhd3eb1b0_0          13 KB
    zope.interface-5.4.0       |   py38h2bbff1b_0         305 KB
    zstd-1.4.9                 |       h19a0ad4_0         478 KB
    ------------------------------------------------------------
                                           Total:       218.2 MB

The following NEW packages will be INSTALLED:

  _anaconda_depends  pkgs/main/win-64::_anaconda_depends-2020.07-py38_0
  cfitsio            pkgs/main/win-64::cfitsio-3.470-he774522_6
  charset-normalizer pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  conda-pack         pkgs/main/noarch::conda-pack-0.6.0-pyhd3eb1b0_0
  debugpy            pkgs/main/win-64::debugpy-1.4.1-py38hd77b12b_0
  fonttools          pkgs/main/noarch::fonttools-4.25.0-pyhd3eb1b0_0
  gmpy2              pkgs/main/win-64::gmpy2-2.0.8-py38h7edee0f_3
  libllvm9           pkgs/main/win-64::libllvm9-9.0.1-h21ff451_0
  matplotlib-inline  pkgs/main/noarch::matplotlib-inline-0.1.2-pyhd3eb1b0_2
  mpc                pkgs/main/win-64::mpc-1.1.0-h7edee0f_1
  mpfr               pkgs/main/win-64::mpfr-4.0.2-h62dcd97_1
  mpir               pkgs/main/win-64::mpir-3.0.0-hec2e145_1
  munkres            pkgs/main/noarch::munkres-1.1.4-py_0

The following packages will be REMOVED:

  jupyter-packaging-0.7.12-pyhd3eb1b0_0

The following packages will be UPDATED:

  anaconda-client                              1.7.2-py38_0 --> 1.8.0-py38haa95532_0
  anaconda-project                       0.9.1-pyhd3eb1b0_1 --> 0.10.1-pyhd3eb1b0_0
  astroid                                2.5-py38haa95532_1 --> 2.6.6-py38haa95532_0
  astropy                              4.2.1-py38h2bbff1b_1 --> 4.3.1-py38hc7d831d_0
  attrs                                 20.3.0-pyhd3eb1b0_0 --> 21.2.0-pyhd3eb1b0_0
  babel                                  2.9.0-pyhd3eb1b0_0 --> 2.9.1-pyhd3eb1b0_0
  bitarray                             1.9.2-py38h2bbff1b_1 --> 2.3.0-py38h2bbff1b_1
  bleach                                 3.3.0-pyhd3eb1b0_0 --> 4.0.0-pyhd3eb1b0_0
  bokeh                                2.3.2-py38haa95532_0 --> 2.3.3-py38haa95532_0
  ca-certificates                      2021.4.13-haa95532_1 --> 2021.7.5-haa95532_1
  certifi                          2020.12.5-py38haa95532_0 --> 2021.5.30-py38haa95532_0
  cffi                                1.14.5-py38hcd4344a_0 --> 1.14.6-py38h2bbff1b_0
  click                                  7.1.2-pyhd3eb1b0_0 --> 8.0.1-pyhd3eb1b0_0
  comtypes                          1.1.9-py38haa95532_1002 --> 1.1.10-py38haa95532_1002
  curl                                    7.71.1-h2a8f88b_1 --> 7.78.0-h86230a5_0
  cython                             0.29.23-py38hd77b12b_0 --> 0.29.24-py38hd77b12b_0
  dask                                2021.4.0-pyhd3eb1b0_0 --> 2021.8.1-pyhd3eb1b0_0
  dask-core                           2021.4.0-pyhd3eb1b0_0 --> 2021.8.1-pyhd3eb1b0_0
  decorator                              5.0.6-pyhd3eb1b0_0 --> 5.0.9-pyhd3eb1b0_0
  distributed                       2021.4.0-py38haa95532_0 --> 2021.8.1-py38haa95532_0
  docutils                              0.17-py38haa95532_1 --> 0.17.1-py38haa95532_1
  et_xmlfile         pkgs/main/noarch::et_xmlfile-1.0.1-py~ --> pkgs/main/win-64::et_xmlfile-1.1.0-py38haa95532_0
  fsspec                                 0.9.0-pyhd3eb1b0_0 --> 2021.7.0-pyhd3eb1b0_0
  gevent                              21.1.2-py38h2bbff1b_1 --> 21.8.0-py38h2bbff1b_1
  greenlet                             1.0.0-py38hd77b12b_2 --> 1.1.1-py38hd77b12b_0
  idna                                    2.10-pyhd3eb1b0_0 --> 3.2-pyhd3eb1b0_0
  imagecodecs                      2021.3.31-py38h5da4933_0 --> 2021.6.8-py38h5da4933_0
  intel-openmp                        2021.2.0-haa95532_616 --> 2021.3.0-haa95532_3372
  ipykernel                            5.3.4-py38h5ca1d4c_0 --> 6.2.0-py38haa95532_1
  ipython                             7.22.0-py38hd4e2768_0 --> 7.26.0-py38hd4e2768_0
  isort                                  5.8.0-pyhd3eb1b0_0 --> 5.9.3-pyhd3eb1b0_0
  itsdangerous                           1.1.0-pyhd3eb1b0_0 --> 2.0.1-pyhd3eb1b0_0
  jinja2                                2.11.3-pyhd3eb1b0_0 --> 3.0.1-pyhd3eb1b0_0
  json5                                          0.9.5-py_0 --> 0.9.6-pyhd3eb1b0_0
  jupyterlab                            3.0.14-pyhd3eb1b0_1 --> 3.1.7-pyhd3eb1b0_0
  jupyterlab_server                      2.4.0-pyhd3eb1b0_0 --> 2.7.1-pyhd3eb1b0_0
  keyring                             22.3.0-py38haa95532_0 --> 23.0.1-py38haa95532_0
  krb5                                    1.18.2-hc04afaa_0 --> 1.19.2-h5b6d351_0
  libcurl                                 7.71.1-h2a8f88b_1 --> 7.78.0-h86230a5_0
  libxml2                                 2.9.10-hb89e7f3_3 --> 2.9.12-h0ad7f3c_0
  lz4-c                                    1.9.3-h2bbff1b_0 --> 1.9.3-h2bbff1b_1
  markupsafe                           1.1.1-py38he774522_0 --> 2.0.1-py38h2bbff1b_0
  matplotlib                           3.3.4-py38haa95532_0 --> 3.4.2-py38haa95532_0
  matplotlib-base                      3.3.4-py38h49ac443_0 --> 3.4.2-py38h49ac443_0
  mkl                                 2021.2.0-haa95532_296 --> 2021.3.0-haa95532_524
  mkl-service                          2.3.0-py38h2bbff1b_1 --> 2.4.0-py38h2bbff1b_0
  mkl_random                           1.2.1-py38hf11a4ad_2 --> 1.2.2-py38hf11a4ad_0
  more-itertools                         8.7.0-pyhd3eb1b0_0 --> 8.8.0-pyhd3eb1b0_0
  nbconvert                                    6.0.7-py38_0 --> 6.1.0-py38haa95532_0
  networkx                                         2.5-py_0 --> 2.6.2-pyhd3eb1b0_0
  nltk                                   3.6.1-pyhd3eb1b0_0 --> 3.6.2-pyhd3eb1b0_0
  notebook                             6.3.0-py38haa95532_0 --> 6.4.3-py38haa95532_0
  numpy                               1.20.1-py38h34a8a5c_0 --> 1.20.3-py38ha4e8547_0
  numpy-base                          1.20.1-py38haf7ebc8_0 --> 1.20.3-py38hc2deb75_0
  openjpeg                                 2.3.0-h5ec785f_1 --> 2.4.0-h4fc8c34_0
  openssl                                 1.1.1k-h2bbff1b_0 --> 1.1.1l-h2bbff1b_0
  packaging                               20.9-pyhd3eb1b0_0 --> 21.0-pyhd3eb1b0_0
  pandas                               1.2.4-py38hd77b12b_0 --> 1.3.2-py38h6214cd6_0
  path                                15.1.2-py38haa95532_0 --> 16.0.0-py38haa95532_0
  pathlib2                             2.3.5-py38haa95532_2 --> 2.3.6-py38haa95532_2
  pillow                               8.2.0-py38h4fa10fc_0 --> 8.3.1-py38h4fa10fc_0
  pkginfo                              1.7.0-py38haa95532_0 --> 1.7.1-py38haa95532_0
  prometheus_client                     0.10.1-pyhd3eb1b0_0 --> 0.11.0-pyhd3eb1b0_0
  pydocstyle                             6.0.0-pyhd3eb1b0_0 --> 6.1.1-pyhd3eb1b0_0
  pyerfa                               1.7.3-py38h2bbff1b_0 --> 2.0.0-py38h2bbff1b_0
  pygments                               2.8.1-pyhd3eb1b0_0 --> 2.10.0-pyhd3eb1b0_0
  pylint                               2.7.4-py38haa95532_1 --> 2.9.6-py38haa95532_1
  pyodbc                              4.0.30-py38ha925a31_0 --> 4.0.31-py38hd77b12b_0
  pytest                               6.2.3-py38haa95532_2 --> 6.2.4-py38haa95532_2
  python-dateutil                        2.8.1-pyhd3eb1b0_0 --> 2.8.2-pyhd3eb1b0_0
  pywin32                                227-py38he774522_1 --> 228-py38hbaba5e8_1
  pyzmq                               20.0.0-py38hd77b12b_1 --> 22.2.1-py38hd77b12b_1
  qtconsole                              5.0.3-pyhd3eb1b0_0 --> 5.1.0-pyhd3eb1b0_0
  qtpy                                           1.9.0-py_0 --> 1.10.0-pyhd3eb1b0_0
  regex                             2021.4.4-py38h2bbff1b_0 --> 2021.8.3-py38h2bbff1b_0
  requests                              2.25.1-pyhd3eb1b0_0 --> 2.26.0-pyhd3eb1b0_0
  rope                                          0.18.0-py_0 --> 0.19.0-pyhd3eb1b0_0
  scikit-learn                        0.24.1-py38hf11a4ad_0 --> 0.24.2-py38hf11a4ad_1
  seaborn                               0.11.1-pyhd3eb1b0_0 --> 0.11.2-pyhd3eb1b0_0
  singledispatch                      3.6.1-pyhd3eb1b0_1001 --> 3.7.0-pyhd3eb1b0_1001
  six                pkgs/main/win-64::six-1.15.0-py38haa9~ --> pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  sortedcontainers                       2.3.0-pyhd3eb1b0_0 --> 2.4.0-pyhd3eb1b0_0
  sphinx                                 4.0.1-pyhd3eb1b0_0 --> 4.0.2-pyhd3eb1b0_0
  sphinxcontrib-htm~                     1.0.3-pyhd3eb1b0_0 --> 2.0.0-pyhd3eb1b0_0
  sphinxcontrib-ser~                     1.1.4-pyhd3eb1b0_0 --> 1.1.5-pyhd3eb1b0_0
  sqlalchemy                           1.4.7-py38h2bbff1b_0 --> 1.4.22-py38h2bbff1b_0
  sqlite                                  3.35.4-h2bbff1b_0 --> 3.36.0-h2bbff1b_0
  testpath                               0.4.4-pyhd3eb1b0_0 --> 0.5.0-pyhd3eb1b0_0
  threadpoolctl                          2.1.0-pyh5ca1d4c_0 --> 2.2.0-pyhbf3da8f_0
  tifffile                            2021.4.8-pyhd3eb1b0_2 --> 2021.7.2-pyhd3eb1b0_2
  tqdm                                  4.59.0-pyhd3eb1b0_1 --> 4.62.1-pyhd3eb1b0_1
  typed-ast                            1.4.2-py38h2bbff1b_1 --> 1.4.3-py38h2bbff1b_1
  typing_extensions                    3.7.4.3-pyha847dfd_0 --> 3.10.0.0-pyh06a4308_0
  urllib3                               1.26.4-pyhd3eb1b0_0 --> 1.26.6-pyhd3eb1b0_1
  wheel                                 0.36.2-pyhd3eb1b0_0 --> 0.37.0-pyhd3eb1b0_0
  xlsxwriter                             1.3.8-pyhd3eb1b0_0 --> 3.0.1-pyhd3eb1b0_0
  xlwings                             0.23.0-py38haa95532_0 --> 0.24.7-py38haa95532_0
  zeromq                                   4.3.3-ha925a31_3 --> 4.3.4-hd77b12b_0
  zipp                                   3.4.1-pyhd3eb1b0_0 --> 3.5.0-pyhd3eb1b0_0
  zope.interface                       5.3.0-py38h2bbff1b_0 --> 5.4.0-py38h2bbff1b_0
  zstd                                     1.4.5-h04227a9_0 --> 1.4.9-h19a0ad4_0

The following packages will be DOWNGRADED:

  anaconda                                   2021.05-py38_0 --> custom-py38_1

install leads to less installation steps than update:

(base) C:\WINDOWS\system32>conda install anaconda
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\toeft\anaconda3

  added / updated specs:
    - anaconda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _anaconda_depends-2020.07  |           py38_0           6 KB
    anaconda-custom            |           py38_1          36 KB
    ca-certificates-2021.7.5   |       haa95532_1         113 KB
    certifi-2021.5.30          |   py38haa95532_0         140 KB
    gmpy2-2.0.8                |   py38h7edee0f_3         145 KB
    libllvm9-9.0.1             |       h21ff451_0          61 KB
    mpc-1.1.0                  |       h7edee0f_1         260 KB
    mpfr-4.0.2                 |       h62dcd97_1         1.5 MB
    mpir-3.0.0                 |       hec2e145_1         1.3 MB
    openssl-1.1.1l             |       h2bbff1b_0         4.8 MB
    ------------------------------------------------------------
                                           Total:         8.4 MB

The following NEW packages will be INSTALLED:

  _anaconda_depends  pkgs/main/win-64::_anaconda_depends-2020.07-py38_0
  gmpy2              pkgs/main/win-64::gmpy2-2.0.8-py38h7edee0f_3
  libllvm9           pkgs/main/win-64::libllvm9-9.0.1-h21ff451_0
  mpc                pkgs/main/win-64::mpc-1.1.0-h7edee0f_1
  mpfr               pkgs/main/win-64::mpfr-4.0.2-h62dcd97_1
  mpir               pkgs/main/win-64::mpir-3.0.0-hec2e145_1

The following packages will be UPDATED:

  ca-certificates                      2021.4.13-haa95532_1 --> 2021.7.5-haa95532_1
  certifi                          2020.12.5-py38haa95532_0 --> 2021.5.30-py38haa95532_0
  openssl                                 1.1.1k-h2bbff1b_0 --> 1.1.1l-h2bbff1b_0

The following packages will be DOWNGRADED:

  anaconda                                   2021.05-py38_0 --> custom-py38_1

2. Official metapackage (= release)

In the following code snippets, update and install lead to the same results. I use install like in the docs.

If you do not want to install a custom version of the metapackage but rather need the most recent official release, install with

conda install anaconda=VersionNumber

Find the VersionNumber

At the time of writing, in 09/2021, the latest available release (Anaconda individual edition) is

conda install anaconda=2021.05

But how to get hold of this VersionNumber?

Have a look at the Anaconda Release notes of the individual edition. If you need an older version, you need to scroll down that page, for example to find 2020.11. The most recent is always on top of the page. If you use a commercial edition, you need to check other release notes.

Thus, something like the 2021.05 version code is the latest release shortcut that you need to find. You can also find the full version name of your OS like for example Anaconda3-2021.05-Windows-x86_64.exe in the list of available Anaconda versions that is directly linked in the docs. It is sorted by name and date, thus, you need to search for the year like "YYYY-MM" / "YYYY-" or scroll through the whole list to find the most recent versions:

https://i.stack.imgur.com/Kfi9u.png

For the example of Windows 10 64 bit, the command could as well be:

conda update anaconda=Anaconda3-2021.05-Windows-x86_64.exe

If you install a release after having installed the most recent custom metapackage, you will see some packages to be removed and quite many to be downgraded slightly. This is because the release is slightly back in time, but therefore also fully trusted.

Docs:

conda update anaconda=VersionNumber grabs the specific release of the Anaconda metapackage, for example conda update anaconda=2019.10. That metapackage represents a pinned state that has undergone testing as a collection.

3. Do not use conda update --all

As to the docs (last sentence of the following quote below), installing the custom (= most recent) metapackage of 2019.07 can be done as well by running

 conda update --all

and if you have virtual environments, you need:

conda update -n myenv --all

YET: This was probably an exception for 2019.07. It does not seem to hold for higher metapackage versions. I checked the differences of conda update --all against conda update anaconda on a row to row comparison (see below, after the quote). Although they seem like twins at first, there were enough small differences to say that you should keep your hands off conda update --all since possible conflicting constraints are even mentioned in the docs.

Docs:

conda update --all will unpin everything. This updates all packages in the current environment to the latest version. In doing so, it drops all the version constraints from the history and tries to make everything as new as it can. This has the same behavior with removing packages. If any packages are orphaned by an update, they are removed. conda update --all may not be able to make everything the latest versions because you may have conflicting constraints in your environment. With Anaconda 2019.07’s newer Anaconda metapackage, conda update --all will make the metapackage go to the custom version in order to update other specs.

The whole output, put against each other on a row to row base, reveals the following remaining row differences. This proves that conda update --all is not just the custom metapackage:

conda update --all output lines not found in conda update anaconda

(base) C:\WINDOWS\system32>conda update --all

The following packages will be downloaded:

    anaconda-navigator-2.0.4   |           py38_0         5.2 MB
    conda-build-3.21.4         |   py38haa95532_0         552 KB
    conda-content-trust-0.1.1  |     pyhd3eb1b0_0          56 KB
    conda-repo-cli-1.0.4       |     pyhd3eb1b0_0          47 KB
    conda-token-0.3.0          |     pyhd3eb1b0_0          10 KB
    menuinst-1.4.17            |   py38h59b6b97_0          96 KB
    python-3.8.11              |       h6244533_1        16.0 MB
                                           Total:       224.8 MB


The following NEW packages will be INSTALLED:

  conda-content-tru~ pkgs/main/noarch::conda-content-trust-0.1.1-pyhd3eb1b0_0
  conda-repo-cli     pkgs/main/noarch::conda-repo-cli-1.0.4-pyhd3eb1b0_0
  conda-token        pkgs/main/noarch::conda-token-0.3.0-pyhd3eb1b0_0


The following packages will be UPDATED:

  anaconda-navigator                          1.10.0-py38_0 --> 2.0.4-py38_0
  conda-build                                 3.20.5-py38_1 --> 3.21.4-py38haa95532_0
  et_xmlfile         pkgs/main/noarch::et_xmlfile-1.0.1-py~ --> pkgs/main/win-64::et_xmlfile-1.1.0-py38haa95532_0
  menuinst                            1.4.16-py38he774522_1 --> 1.4.17-py38h59b6b97_0
  python                                   3.8.8-hdbf39b2_5 --> 3.8.11-h6244533_1
  six                pkgs/main/win-64::six-1.15.0-py38haa9~ --> pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  sphinxcontrib-htm~                     1.0.3-pyhd3eb1b0_0 --> 2.0.0-pyhd3eb1b0_0
  sphinxcontrib-ser~                     1.1.4-pyhd3eb1b0_0 --> 1.1.5-pyhd3eb1b0_0

conda update anaconda output lines not found in conda update --all

(base) C:\WINDOWS\system32>conda update anaconda

  added / updated specs:
    - anaconda

The following packages will be downloaded:

    cfitsio-3.470              |       he774522_6         512 KB
    imagecodecs-2021.6.8       |   py38h5da4933_0         6.1 MB
    jinja2-3.0.1               |     pyhd3eb1b0_0         110 KB
    tifffile-2021.7.2          |     pyhd3eb1b0_2         135 KB
    typed-ast-1.4.3            |   py38h2bbff1b_1         135 KB
                                           Total:       209.8 MB

The following NEW packages will be INSTALLED:

  cfitsio            pkgs/main/win-64::cfitsio-3.470-he774522_6


The following packages will be UPDATED:

  et_xmlfile         pkgs/main/noarch::et_xmlfile-1.0.1-py~ --> pkgs/main/win-64::et_xmlfile-1.1.0-py38haa95532_0
  imagecodecs                      2021.3.31-py38h5da4933_0 --> 2021.6.8-py38h5da4933_0
  jinja2                                2.11.3-pyhd3eb1b0_0 --> 3.0.1-pyhd3eb1b0_0
  six                pkgs/main/win-64::six-1.15.0-py38haa9~ --> pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  sphinxcontrib-htm~                     1.0.3-pyhd3eb1b0_0 --> 2.0.0-pyhd3eb1b0_0
  sphinxcontrib-ser~                     1.1.4-pyhd3eb1b0_0 --> 1.1.5-pyhd3eb1b0_0
  tifffile                            2021.4.8-pyhd3eb1b0_2 --> 2021.7.2-pyhd3eb1b0_2
  typed-ast                            1.4.2-py38h2bbff1b_1 --> 1.4.3-py38h2bbff1b_1

Therefore, conda update --all is not recommended, better stick to the custom metapackage if you need the highest possible update, or take the official metapackage if you are fine with a lag of a couple of months and a collection of packages without any conflicts is most important (for example, if you are in a production environment).

Result: Which to install: official or custom metapackage?

Some answers or comments say that the custom metapackage install might need to be run twice to get to a proper state. I cannot confirm this (tested with conda install anaconda and conda update anaconda, but I am also in a fresh Python installation). This is still a hint that it might be more stable to install the most recent official metapackage (= release, conda install anaconda=VersionNumber = conda update anaconda=VersionNumber) which can have a lag of some months.

On the other hand, the custom metapackage (the most recent trusted package collection) might be good if you want the most recent versions available. Then run conda install anaconda or the even stronger command conda update anaconda.

This is also the way to update Spyder:

https://i.stack.imgur.com/ikcqi.png

They do not even use conda update conda before conda update anaconda, the latter seems enough.

Small "proof": I used conda update conda at first, and after that, conda update anaconda had nothing to do anymore, conda update conda had done all or the tasks.

conda update anaconda 
Collecting package metadata (current_repodata.json): done Solving environment: done

# All requested packages already installed.

That again sounds as if both commands are made the same now, perhaps they have not been the same only in the past.

The choice is up to you, it depends on how urgently you need to be up-to-date with some packages. Just start the installer to see what would happen, you can still enter n to cancel the installation. I am going to take

conda update anaconda

without conda update conda.

And do not take conda update --all unless you need the most recent update of some package, for example as a requirement for another package to be installed. I ran into that when testing --all, only after that, a new tensorflow add-on was suggested for download, but not after the other commands. Normally, you will not need to be up to date on the point, therefore do not use --all.


P
Peter Mortensen

On Mac, open a terminal and run the following two commands.

conda update conda
conda update anaconda

Make sure to run each command multiple times to update to the current version.


multiple time? doest make sense to do that.
In my experience, if you just run the commands once it does not update to the latest versions of the python packages. So I suggest running it multiple times.
This is duplicate of another answer here on the same page: stackoverflow.com/a/46842054/109618
P
Peter Mortensen

Use:

conda create -n py37 -c anaconda anaconda=5.3.1
conda env export -n py37 --file env.yaml

Locate the env.yaml file in C:\Windows\System32 and run the cmd as administrator:

conda env update -n root -f env.yaml

Then it works!


P
Peter Mortensen

This can update the Python instance only:

conda update python