0

OS: Elementary

After installing anaconda3, running conda command displays:

conda: command not found

The path in .bashrc has been appended with proper username.

Part of .bashrc

    enter c        __el_LAST_EXECUTED_COMMAND="${BASH_COMMAND}"
        printf "\033]0;%s\007" "$1"
    }

    # Show the currently running command in the terminal title:
    # http://www.davidpashley.com/articles/xterm-titles-with-bash.html
    update_tab_command()
    {
        # catch blacklisted commands and nested escapes
        case "$BASH_COMMAND" in
            *\033]0*|update_*|echo*|printf*|clear*|cd*)
            __el_LAST_EXECUTED_COMMAND=""
                ;;
            *)
            put_title "${BASH_COMMAND}"
            ;;
        esac
    }
    preexec_functions+=(update_tab_command)
    ;;
*)
    ;;
esac
# added by Anaconda3 2.4.0 installer
export PATH="/home/my_name/anaconda3/bin:$PATH"

Also:

echo $PATH
usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
algoProg
  • 718
  • 2
  • 11
  • 27

3 Answers3

0

You may want to make sure that your current active shell is bash (and not, for example, csh).

If you have made sure that the path is there in your .bashrc, try following steps:

$ bash

$ conda -h

Here, the first bash command will switch to bash shell in your current terminal. Now since you're executing in bash shell, it should be able to find path from your .bashrc for conda command.

Community
  • 1
  • 1
Maunesh Ahir
  • 486
  • 4
  • 4
0

So after you set the path at .bashrc file... go to the terminal and run the following command
source .bashrc and then run the command conda

If it gives a Bad Interpreter then run the following command cat ~/anaconda3/bin/conda

You will get following:

#!/opt/example/anaconda3/bin/python
if __name__ == '__main__':
import sys
import conda.cli
sys.exit(conda.cli.main())

Changing the first line to point a correct interpreter

Jai
  • 3,211
  • 2
  • 17
  • 26
0

Set the correct path in the .bashrc or .bash_profile file, export PATH=/anaconda3/bin:$PATH works if you have installed anaconda in the home folder. Do not add '../' to the path. Make sure that while copying the path from the web everything is pasted correctly in the bash file, it is case and font sensitive. After doing this, open a new terminal and type source activate base or source activate root before using conda command for the first time. Check by typing conda -V and it should display 'conda version_number'

Malgo
  • 1,871
  • 1
  • 17
  • 30