3
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Save the above command in your ~/.bashrc file and after that reload .bashrc file by using source ~/.bashrc command. $\endgroup$ – Syed Nauyan Rashid Sep 10 '18 at 14:29
3
$\begingroup$

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.

| improve this answer | |
$\endgroup$
2
$\begingroup$

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

It will be executed each time you call a terminal.

| improve this answer | |
$\endgroup$
2
$\begingroup$

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.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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