以前,我在~/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环境?