What Is The Difference Between Conda Install And Conda Update?
Solution 1:
It's exactly what the documentation you provided says. For conda install:
Installs a list of packages into a specified conda environment.
and for conda update:
Updates conda packages to the latest compatible version.
Solution 2:
In the context of the text from the documentation that was cited in the question
... Conda attempts to install the newest versions of the requested packages....
it seems important to stress that the documentation is not perfectly clear about the difference between install and update. The fact that the documentation shares the same explanation about what is installed without clarifying the conditions is certainly a bit confusing (at least to me).
The implicit distinction between installing and updating is not only that you get an error if you try to update a package that does not exist (what was mentioned in the comments to the question), but also that the side-effects (handling of dependencies) are different for install
and update
.
A real world example:
(base)535>condainstall-dsphinxCollectingpackagemetadata(current_repodata.json):doneSolving environment:done## Package Plan ##environment location:/data/anaconda3added / updated specs:-sphinxThe following packages will be downloaded:package|build---------------------------|-----------------sphinx-3.0.3|py_01.1MB------------------------------------------------------------Total:1.1MBThe following packages will be UPDATED:sphinx2.4.0-py_0-->3.0.3-py_0
while updating leads to
(base)536>condaupdate-dsphinxCollectingpackagemetadata(current_repodata.json):doneSolving environment:done## Package Plan ##environment location:/data/anasynth_nonbp/anaconda3added / updated specs:-sphinxThe following packages will be downloaded:package|build---------------------------|-----------------astroid-2.4.1|py36_0279KB...sphinx-3.0.3|py_01.1MB...zipp-3.1.0|py_013KB------------------------------------------------------------Total:39.8MBThe following NEW packages will be INSTALLED:importlib-metadatapkgs/main/linux-64::importlib-metadata-1.6.0-py36_0prompt-toolkitpkgs/main/noarch::prompt-toolkit-3.0.4-py_0tomlpkgs/main/linux-64::toml-0.10.0-py36h28b3542_0The following packages will be REMOVED:asn1crypto-1.3.0-py36_0The following packages will be UPDATED:astroid2.3.3-py36_0-->2.4.1-py36_0...sphinx2.4.0-py_0-->3.0.3-py_0...zipp2.2.0-py_0-->3.1.0-py_0
Without having investigated this into the last details it seems one can summarize as follows (last tested with conda 4.8.3
):
conda install
installs the newest version of the requested package with minimal changes to the installed packages.
conda update
will update to the most recent version if the package exists and will give an error if not. Furthermore it also updates all dependencies of the packages listed as argument. conda update
will update these even if the package in the argument is already the latest version.
Post a Comment for "What Is The Difference Between Conda Install And Conda Update?"