Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the correct command to update all anaconda python packages?

I am using python Anaconda. I am confused which is the correct command to update all the Anaconda packages to the latest version. There seems to be 2 commands that can be used;

$ conda update --all

or

$ conda update anaconda

After running the latter, anaconda was upgraded to ver4.4. Subsequently, I run the former which asked if I wanted to downgrade some packages. This is what confused me. Which is the correct command to use?

like image 931
user3848207 Avatar asked Aug 22 '17 07:08

user3848207


People also ask

How do you upgrade everything in anaconda?

To update Anaconda to the latest version, type the following command. To update the Anaconda to a specific version, type the following command. The command conda update anaconda=VersionNumber grabs the specific release of the Anaconda metapackage; for example, conda update anaconda=2019.10.

What is conda update -- all?

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

The anaconda package is a "meta"-package, which means that it doesn't contain any packages itself, it merely sets the specific version of a number of packages that Anaconda Inc. (formerly Continuum IO) include with the "Anaconda distribution". Therefore, when you type

conda update anaconda

you are telling conda to update to the most recent version of the anaconda package, and install all the dependencies with their specific versions as specified in the anaconda package. This has the advantage that Anaconda Inc. (formerly Continuum IO) have tested the packages together and are making some assurance that there won't be any conflicts.

When you type

conda update --all

conda uses its internal algorithm to try and resolve the versions of the dependencies. I'm not sure of the details, but this may result in some packages being upgraded, but others being downgraded because some package that you have installed requires a downgraded version of the dependency. Particularly with the number of packages installed by the anaconda meta-package, conflicts are sure to happen, and conda is doing its best to resolve all those.

As for which to use, I'd say that if you started with anaconda, keep going with anaconda to avoid version conflicts (i.e., conda update anaconda). However, if you have a fresh environment or you're using Miniconda where you don't have the anaconda meta-package installed, then conda update --all is probably the better choice. Your mileage may vary.

like image 157
darthbith Avatar answered Oct 10 '22 22:10

darthbith