9

This question already has an answer here:

Whenever I open a terminal, I have to write

export PATH=~/anaconda3/bin:$PATH

to use any feature of anaconda

I want a persistent path.

marked as duplicate by David Foerster, Thomas, Kevin Bowen, Eric Carvalho, muru Aug 6 '18 at 1:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    I'm voting to leave this question open despite the similarities because this problem is so common to Anaconda that it deserves a separate question for Anaconda users. – karel Jul 31 '18 at 3:49
  • Also I don't think it would be a good idea to merge the two questions because that would require deleting Klaus-Dieter Warzecha's answer. – karel Jul 31 '18 at 6:46
15

the file .bashrc (hidden file), located in the home directory, runs codes every time a new terminal is opened.

Then add a line on it:

export PATH=~/anaconda3/bin:$PATH
  • I'm running Mint and I have this line in my .bashrc. But I note that .bashrc is not run when I start an env console from within anaconda navigator. I added that line to /etc/bash.bashrc and it worked (single user system) – PhilW Sep 30 '18 at 17:06
  • it worked on my ubuntu 18.04 LTS, thanks @Vitor – Mohammad Heydari Nov 9 '18 at 14:43
5

Wouldn't it be nice if somebody else would handle that for you? ;-)

Edit your .profile and add something like the following lines:

if [ -d "$HOME/anaconda3/bin" ] ; then
    PATH="$HOME/anaconda3/bin:$PATH"
fi
  • 1
    What does the if statement with the -d indicate here? – Rik Sep 14 '16 at 15:26
  • @Rik Square brackets with -d are used to test if the string is a directory. – Klaus-Dieter Warzecha Sep 14 '16 at 21:34
0

Reinstall anaconda, and notice that at the end of the install process there is a optional selection that allow you to add conda command to your PATH.

You can choose to say yes, and then you can use the command conda.

-1

Start with:

sudo nano ~/.bashrc

go down to the last line in the file and add

export PATH=~/anaconda3/bin:$PATH

then Ctrl+X and then enter

open a new terminal and enjoy anaconda--navigator

Not the answer you're looking for? Browse other questions tagged or ask your own question.