3

I have installed Anaconda, but every time I open Terminal I have to go give the command:

export PATH=~/anaconda3/bin:$PATH  

How can I fix this issue?

Stephen Rauch
  • 1,783
  • 11
  • 22
  • 34
user254087
  • 65
  • 2
  • 6

3 Answers3

4

You can make sure that command is executed for every terminal (meaning Anaconda will be found) by adding it to your user's bash profile.

Open a terminal and follow these steps:

  1. open the terminal profile: gedit ~/.bashrc

  2. at the end of the file, add: export PATH=~/anaconda3/bin:$PATH

  3. save the file (control+s) and close it

  4. load the changed profile: source ~/.bashrc

Now this terminal window (and any new ones) should find Anaconda! See which version of Python is now the default, using which -a python. First in the list should be something like /home/username/anaconda3/bin/python

The Anaconda setup/installation usually asks you if you want to prepend Anaconda to start of your path, so whoever installed it must have said no or skipped that step.

n1k31t4
  • 14,858
  • 2
  • 30
  • 49
2

Write your command in your .bashrc (access at ~/.bashrc )

It will be executed each time you call a terminal.

alexandre_d
  • 418
  • 4
  • 12
2

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

Some other solutions are also provided here.

ebrahimi
  • 1,307
  • 7
  • 20
  • 40