Closed adomingues closed 3 years ago
Hi all,
any news on this?
Cheers, António
Hi, in my experience mamba isn't usually very "greedy". I think one "trick" is to always use strict channel priority.
Any chance you can reconstruct a test case for this behavior?
No problem, thank you for looking into this. I will create a fairly complex env but it should only take few minutes to install nonetheless:
conda activate base
conda create -n test_mamba r=3.6 r-base r-tidyverse r-rlang r-rjava r-hdf5r r-essentials r-devtools mamba
conda activate test_mamba
# mamba (0.8.2)
mamba install r-here
And this the summary of the number of packages that will be affected using mamba
:
Summary:
Install: 59 packages
Change: 28 packages
Upgrade: 139 packages
Downgrade: 2 packages
Total download: 194 MB
If I now use conda to install that same package this is the output:
conda install r-here
## Package Plan ##
environment location: /mnt/genomics/envs/test_mamba
added / updated specs:
- r-here
The following packages will be downloaded:
package | build
---------------------------|-----------------
r-here-0.1 | r36h6115d3f_0 35 KB
------------------------------------------------------------
Total: 35 KB
The following NEW packages will be INSTALLED:
r-here pkgs/r/noarch::r-here-0.1-r36h6115d3f_0
As you can appreciate that a massive difference.
I then set the channel prriority to strict
and re-try with mamba:
conda config --set channel_priority strict
mamba install r-here
Summary:
Install: 5 packages
Change: 124 packages
Upgrade: 25 packages
Downgrade: 7 packages
Total download: 154 MB
The numbers change but the behavior is still very different from that of conda install
.
If this test case is too complex let me know and I will try to simplify it.
Cheers
The problem is that r-base is not pinned, and then mamba tries to update r-base to r-base=4.0
You can pin a package by adding r-base 3.6.*
to $CONDA_PREFIX/conda-meta/pinned
e.g.
echo "r-base 3.6.*" > $CONDA_PREFIX/conda-meta/pinned
that leads to the same small environment change as with conda.
The other alternative is to specify mamba install r-base=3.6 r-here
For python there is some hard-coded behavior in mamba that "pins" the minor version of python. We should consider doing that for other programming languages such as Ruby and R as well.
PS: please install mamba into the base environment!
Thanks a lot @wolfv!
The other alternative is to specify mamba install r-base=3.6 r-here
I will use this for now. If it becomes much of an hassle I will pin.
For python there is some hard-coded behavior in mamba that "pins" the minor version of python. We should consider doing that for other programming languages such as Ruby and R as well.
For me and as user naively expecting similar default behaviors from mamba and conda, this would make sense. Alternately including in the documentation this option of pinning for other languages would also be ok.
PS: please install mamba into the base environment!
Honestly When I first used mama I was doing it, but at some point I thought that I had to install in any new env. Good to know I was wrong.
Dear all,
first of all thank you for mamba! It literally saves hours of work.
I have spotted a behaviour which might be a bug or a feature:
When installing an r-packge in a fairly complex environment, mamba asks to a large number of dependencies:
However I am asking for a specific version of the package which I know it should not need any updates for dependencies - I have the same environment in a separate machine with said package. Furthermore, if I try to install the package with
conda install
no dependencies are installed (as expected):Is this difference in behaviour between
mamba
andconda
expected? And how do I stop mamba from being so "greedy" with dependencies?Cheers.