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?
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityI 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?
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:
open the terminal profile: gedit ~/.bashrc
at the end of the file, add: export PATH=~/anaconda3/bin:$PATH
save the file (control+s
) and close it
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.
Write your command in your .bashrc
(access at ~/.bashrc
)
It will be executed each time you call a terminal.
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.