Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the right way to update Anaconda and Conda base & environments?

Tags:

conda

anaconda

Just wondering as what is the right way to update Anaconda and Conda installation and virtual environments. Here is my confusion step by step:

  1. When I run command conda update anaconda, it updates/downgrades alot of packages.
  2. Then I ran conda update conda, which again updates/downgrades some packages.
  3. Next, I ran conda update --update-all it starts downgrading/upgrading different packages.
  4. Lastly, just to make sure that everything's updated, I ran conda update anaconda again. I was expecting a message like Everything's up to date but to my surprise it was again showing a huge list of packages that needed to be updated/downgraded again?

    What am I doing wrong here? It appears to me as if I am going in circles with these commands. Any help?

like image 761
exan Avatar asked Aug 29 '19 00:08

exan


People also ask

What does conda update base conda do?

Updates conda packages to the latest compatible version. This command accepts a list of package names and updates them to the latest versions that are compatible with all other packages in the environment. Conda attempts to install the newest versions of the requested packages.


1 Answers

You're not doing anything wrong per se, but it just doesn't make much sense to ever run conda update anaconda and conda update --all right after each other on the same env - they represent two completely different configurations.

Update Anaconda

Anaconda is a Python distribution that bundles together a ton of packages. Presumably, a bunch of testing goes into verifying that all the package versions and builds are compatible with each other. Because this takes time to do, the Anaconda team only releases new distributions (i.e., a new anaconda version) every couple months or so. If you want a stable set of packages that have been tested for interoperability, then do conda update anaconda.

Update All

In between Anaconda releases, new versions of many packages are still released on the Anaconda channel, and if you run conda update --all you're going to inevitably get ahead of the versions specified in the anaconda bundle. If you want the newest individual package releases and don't mind potentially working with package builds that aren't thoroughly tested for integration, then run conda update --all.

It may be worth noting that people who prioritize having access to the latest versions of packages often seem to prefer Conda Forge, because it tends to have more frequent package releases. However, in my opinion, there's almost no point to installing Anaconda if you're going to switch most packages to Conda Forge anyway. Instead, just install Miniconda and only install what you want from Conda Forge at the start.

Update None

Personally, I will rarely run conda update on an env once I've harden the requirements for a project. Every time you update an env, you risk breaking code that you've already written. Instead, Conda makes it quite easy to create new envs, and if they have a lot of overlap with other envs, then the envs can be quite light due to sharing packages across envs via hardlinking.

Update Conda

The one exception to everything above is the conda package, which is the very infrastructure you're using to manage packages and envs. That, one should update just like any other package manager (e.g., a pip or a homebrew).

like image 126
merv Avatar answered Sep 22 '22 04:09

merv