Mamba activate not working Mac M chip

Hey folks,
I’m trying to activate fastai (or pytorch) using “mamba” from my M2 Mac terminal. However, I’m getting an error:

Run 'mamba init' to be able to run mamba activate/deactivate
and start a new shell session. Or use conda to activate/deactivate

I’m new to handling environments and shell. Can someone pls help me out ?
“mamba install fastai” command worked successfully.
“conda activate fastai” worked successfully as well.
But mamba activate fastai is giving the above error.

I ran mamba init and started a new terminal session, but it didn’t work. Again the same error.
Can someone pls help me out. Thanks!

Hey Kashish, :wave:

Copy to contents of ~/.bash_profile and copy it to the bottom of ~/.zshrc and run:

source ~/.zshrc

Hopfully that should fix it! Let me know if you have any issues. :slightly_smiling_face:

1 Like

Hey , thanks for reply. What should I copy from bash to zsch ?
These are the contents of my ~/zshrc file:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/kashmkj/miniforge3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/kashmkj/miniforge3/etc/profile.d/conda.sh" ]; then
        . "/Users/kashmkj/miniforge3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/kashmkj/miniforge3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

These are the contents of my ~/bash_profile file:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/kashmkj/miniforge3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/kashmkj/miniforge3/etc/profile.d/conda.sh" ]; then
        . "/Users/kashmkj/miniforge3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/kashmkj/miniforge3/bin:$PATH"
    fi
fi
unset __conda_setup

if [ -f "/Users/kashmkj/miniforge3/etc/profile.d/mamba.sh" ]; then
    . "/Users/kashmkj/miniforge3/etc/profile.d/mamba.sh"
fi
# <<< conda initialize <<<

Awesome, they look correct. :slightly_smiling_face:

I was just having a look at the mamba docs did you run the following after restarting your terminal?

micromamba activate
1 Like

Hey thanks for the reply. Yeah, after a few nitty-gritty changes, i was able to activate using micromamba. But now, alone “mamba/conda” command doesn’t work…lol. I’m only able to use micromamba. Need to check what went wrong in my installation.

Oh no! :upside_down_face:

Daft question, can you have both conda and mamba installed and accessible on the terminal at the same time? :thinking:

I ended up removing conda and just using mamba :person_shrugging:

Thank you, this did it for me…Was so grateful, I honestly made an account just to be able to leave you some love lol. Really appreciate it!

2 Likes