Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mamba 2.0 - installing in the base env without activation #3426

Closed
SylvainCorlay opened this issue Aug 30, 2024 · 2 comments · Fixed by #3447
Closed

Mamba 2.0 - installing in the base env without activation #3426

SylvainCorlay opened this issue Aug 30, 2024 · 2 comments · Fixed by #3447
Labels
type::bug Something isn't working
Milestone

Comments

@SylvainCorlay
Copy link
Member

With Conda (and Mamba 1.x), running conda install foobar or mamba install foobar will install foobar in the base environment when no environment is activated. However, micromamba and mamba 2.0 will complain that no prefix is specified.

This is the root cause for the current failure when updating repo2docker to the latest rc of mamba 2.0.

I believe that we should support this behavior, as it will generally be expected from conda users who don't use environments much.

A possible approach would be to

  1. Set up the mamba package so that the root prefix is set to the installation prefix of mamba.
  2. Always default to the root prefix when installing a package (either for both micromamba and mamba, or just for mamba, behind a flag).
@SylvainCorlay SylvainCorlay added the type::bug Something isn't working label Aug 30, 2024
@SylvainCorlay SylvainCorlay added this to the 2.0.0 milestone Aug 30, 2024
@SylvainCorlay
Copy link
Member Author

SylvainCorlay commented Aug 30, 2024

A first issue regarding Item 1 (on setting up the mamba package so that the root prefix is set to the installation prefix of mamba), is that running mamba shell init from the installed mamba package (with 2.0.0rc4) populates bashrc with:

# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba shell init' !!
export MAMBA_EXE='/home/sylvain/micromamba/envs/mamba/bin/mamba';
export MAMBA_ROOT_PREFIX='/home/sylvain/micromamba';
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__mamba_setup"
else
    alias mamba="$MAMBA_EXE"  # Fallback on help from mamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<

The fact that MAMBA_ROOT_PREFIX is set to HOME/micromamba is obviously a bug.

@Hind-M
Copy link
Member

Hind-M commented Sep 2, 2024

The fact that MAMBA_ROOT_PREFIX is set to HOME/micromamba is obviously a bug.

I don't get why this is a bug. Do you mean that it should be HOME/mamba instead?
IIRC HOME/micromamba is only used if it already exists (from previous usage of micromamba 1.x).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
2 participants