python的发行版本可以分为两大类_使用两个不同的Python发行版

小编典典

当然,如果您想单独使用Anaconda发行版,则可以设置一个别名来运行该版本,并将标准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.

>>>

要再次使用您的其他发行版,只需加载一个新的终端,从而使anaconda脱离您的路径。

2020-12-20

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值