Installing a package in Anaconda takes at least 15 seconds, if the package is already installed the resolving environment still takes time:
time /opt/Anaconda3-2019.10/bin/conda install --override-channels --quiet -y plotly-orca
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
# All requested packages already installed.
real 0m15.067s
user 0m13.533s
sys 0m0.401s
But checking if the package (regardless of the version) is installed takes only 2 seconds:
time /opt/Anaconda3-2019.10/bin/conda list --quiet plotly-orca
# packages in environment at /opt/Anaconda3-2019.10:
#
# Name Version Build Channel
plotly-orca 1.3.1 1 plotly
real 0m2.303s
user 0m2.227s
sys 0m0.064s
I'm aware I could do a little bit of Shell scripting around this but there is a better way to install a package ONLY if is not present already?
Does conda has an API (similar to pip) that you could use to check for this?
I looked through all the options on the with conda install --help , found nothing I could use (--satisfied-skip-solve seems to help for already installed packages but does it break new installations?).
Thanks!