conda-forge / miniforge

A conda-forge distribution.
https://conda-forge.org/miniforge
Other
6.14k stars 318 forks source link

accidentally not enabling `conda init` on installation #370

Open jgunstone opened 1 year ago

jgunstone commented 1 year ago

Comment:

mamba is awesome. thank you for this great software.

I just installed from mambaforge as per: https://github.com/conda-forge/miniforge#mambaforge

and accidentally hit enter while waiting for the installation such that it "no" before i realised what happened. i wanted to hit "yes".

image

I then spent the next 20mins trying to figure out what to put in the .bashrc file to allow for the conda init. Didn't get anywhere so in the end deleted my wsl distro and started again from scratch. the whole experience was pretty annoying.

Suggestions:

  1. don't default to "no" in the CLI. default to nothing and require the user to choose. give guidance as required.
  2. in the docs tell the user what to add to the .bashrc file to reproduce what hitting "yes" does, i.e. <path> is path to mambaforge root installation
    
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('<path>/mambaforge/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
    eval "$__conda_setup"
    else
    if [ -f "<path>/mambaforge/etc/profile.d/conda.sh" ]; then
        . "<path>/mambaforge/etc/profile.d/conda.sh"
    else
        export PATH="<path>/mambaforge/bin:$PATH"
    fi
    fi
    unset __conda_setup

if [ -f "/mambaforge/etc/profile.d/mamba.sh" ]; then . "/mambaforge/etc/profile.d/mamba.sh" fi

<<< conda initialize <<<

hmaarrfk commented 1 year ago

I feel your pain. Changing default behavior is hard....

If you forget, i think the easiest is to run

"${HOME}/mambaforge/bin/conda" init

which is what the installer would have done at the end of it