Reputation: 7656
I have installed the Anaconda for Mac, but there is something wrong with me:
when I type the commandwhich conda
or which ipython
, I get conda not found
and ipython not find
Then I find this command export PATH=~/anaconda/bin:"$PATH"
works for me. It solves the problem above, but everytime I rerun the terminal the problem is still there, I have to type it again.
so I want to find a way to solve the problem fundamentally
I have tried to add it into the ~/.bashrc
, ~/.profile
, ~/.bash_profile
, but these don't work for me.
Upvotes: 16
Views: 70916
Reputation: 11
Best fix is to set your conda base to auto activate.
If you entered "no", when it asked whether you want to automatically initialize conda whenever you need to use it, it will not update your $SHELL variable by adding:
export PATH="/opt/anaconda3/bin:$PATH"
in /home/user/.bashrc
Then do :
source ~/.bashrc
check whether the path is exported by
echo $PATH
after this do :
conda init
For Permanent fix :
The base environment is activated by default
conda config --set auto_activate_base True
The base environment is not activated by default
conda config --set auto_activate_base False
I hope it will solve your problem.
Upvotes: 1
Reputation: 39
If you're using ZShell follow the steps below:
Please note that the homebrew path on Apple silicon is /opt/homebrew/bin
Upvotes: 0
Reputation: 576
I run on MacOs Catalina 10.15 and this did the trick for me: shell is zsh !
$ source /Users/myprofilename/anaconda3/bin/activate
then
$ conda init zsh
the new anaconda documentation also highlights this:
Upvotes: 9
Reputation: 31
Make sure you're not using ZShell or another form of a shell. If the case you'd have to add the path to your respective shell file, e.g .zshrc
.
Upvotes: 3
Reputation: 21
sudo xed /etc/environment
after open this archive add :/home/youruser/anaconda3/bin
Upvotes: 2
Reputation: 1878
Try this in .bash_profile
export PATH="$HOME/anaconda/bin:$PATH"
Then try launching a new terminal and running:
echo $PATH
The output should start with /anaconda/bin:
If that still doesn't work... A work around might be to invoke bash after running terminal i.e. type "bash". Which should cause bash to launch with .bash_profile
Upvotes: 21