问题描述
我已经安装了适用于Mac的Anaconda,但是我有问题:
I have installed the Anaconda for Mac, but there is something wrong with me:
当我键入命令which conda
或which ipython
时,我得到conda not found
和ipython not find
when I type the commandwhich conda
or which ipython
, I get conda not found
and ipython not find
然后我发现此命令export PATH=~/anaconda/bin:"$PATH"
对我有用.它解决了上面的问题,但是每次我重新运行终端时,问题仍然存在,我必须再次输入.
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
我试图将其添加到~/.bashrc
,~/.profile
,~/.bash_profile
中,但是这些对我不起作用.
I have tried to add it into the ~/.bashrc
, ~/.profile
, ~/.bash_profile
, but these don't work for me.
推荐答案
在 .bash_profile
Try this in .bash_profile
export PATH="$HOME/anaconda/bin:$PATH"
然后尝试启动新终端并运行:
Then try launching a new terminal and running:
echo $PATH
输出应以/anaconda/bin:
如果仍然不起作用...一种解决方法是在运行终端后调用bash,即键入" bash ".这应该导致bash使用.bash_profile启动
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
这篇关于我必须输入export PATH =〜/anaconda/bin:"$ PATH"每次我重新运行终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!