是否可以将anaconda2预先设置为anaconda3中的py2环境?

时间:2018-08-01 11:38:00

标签: python anaconda

以前,我在~/anaconda2下安装了anaconda2。最近,我将anaconda3安装到~/anaconda3并替换了:

export PATH="/home/xxx/anaconda2/bin:$PATH"

具有:

export PATH="/home/xxx/anaconda3/bin:$PATH"

每次我想使用python2时,我都会手动编辑.bashrc并将该行改回export PATH="/home/xxx/anaconda2/bin:$PATH"并开始新的终端会话。

最近,我注意到here,可以在不创建新会话的情况下将python3切换为python2。但是,当我运行conda create --name py2 python=2.7时,会得到以下输出:

conda create --name py2 python=2.7
Solving environment: done

## Package Plan ##

  environment location: /home/xxx/anaconda3/envs/py2

  added / updated specs: 
    - python=2.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.15              |       h1571d57_0        12.1 MB
    ... (many lines not important)
    ------------------------------------------------------------
                                           Total:        16.3 MB

The following NEW packages will be INSTALLED:

    ca-certificates: 2018.03.07-0           
    .... (many lines not important)    

Proceed ([y]/n)? n

似乎这将启动新的python2安装。我的问题是:是否可以指示conda create使用现有的~/anaconda2作为py2环境,而不是从头安装新的python2环境?

0 个答案:

没有答案