Advertisement

[SOLVED] zsh: command not found: conda.

zsh command not found conda in ubuntu

Suppose that if you have already installed anaconda into your Linux machine using bash and later on switched to zsh. If you encounter such thing there might be two scenario:

In the first you haven't installed zsh and other you have installed anaconda and switched to zsh in the second senario you will getting the screen look like this:


solution:

In the terminal type the command:

paste this code at the last of the .zshrc file :

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

Hence close the terminal and restart it again. Problem solved.

Do do let me know if more could be added or if anything don't work.

Post a Comment

0 Comments