当然,如果要单独使用Anaconda发行版,可以设置别名来运行该版本,并将stock python保留为默认值。
在您的.bash_profile文件中,Anaconda安装程序可能会放置以下行:export PATH="/path/to/your/anaconda/bin:$PATH"
将其注释掉,并添加别名;例如alias pyconda='/path/to/your/anaconda/bin/python'
然后,可以通过在新终端中运行pyconda来运行Anaconda python发行版。
更新
当你想使用它而不仅仅是python时,最好把anaconda安装中的所有东西都放到你的路径中(这就是为什么ipython最初会崩溃的原因)。
为此,请设置一个别名,如下所示:alias anacondainit='export PATH="/path/to/your/anaconda/bin:$PATH"'
那么您的anaconda安装将是该终端会话中所有内容的默认安装。
例如,打开新终端后,请尝试以下操作:amorgan$ python # on a freshly opened terminal, this will load your default distro
Python 2.7.2 |EPD 7.2-1 (32-bit)| (default, Sep 7 2011, 09:16:50)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "packages", "demo" or "enthought" for more information.
>>> exit()
amorgan$ anacondainit #initialize anaconda
amorgan$ python #now when we run python, it will load the anaconda distro
Python 2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Nov 11 2013, 10:49:09)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
若要再次使用其他分发版,只需加载一个新的终端,从而使水蟒离开您的路径。