I have to type export PATH=~/anaconda/bin:“$PATH”

2019-03-27 09:23发布

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.

3条回答
爷的心禁止访问
2楼-- · 2019-03-27 09:57

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

查看更多
聊天终结者
3楼-- · 2019-03-27 09:57

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.

查看更多
看我几分像从前
4楼-- · 2019-03-27 10:03
sudo xed /etc/environment

after open this archive add :/home/youruser/anaconda3/bin

查看更多
登录 后发表回答