conda "重命名" 环境 (通过clone旧环境来创建新环境,然后删除旧环境)

参考:https://www.jianshu.com/p/7265011ba3f2

注:conda并没有对环境重命名这一操作,我们可以通过先clone旧的环境,然后删除旧环境(可选)来等效地对旧环境重新命名

下面是本机实际操作:

  • step1. clone旧环境来创建新环境
tsq@$ conda create -n py2 --clone tsqPy2

Source:      /home/tsq/anaconda2/envs/tsqPy2
Destination: /home/tsq/anaconda2/envs/py2
Packages: 16
Files: 18766
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

tsq@$ conda info -e

# conda environments:
#
base                  *  /home/tsq/anaconda2
caffe                    /home/tsq/anaconda2/envs/caffe
cuda9.0                  /home/tsq/anaconda2/envs/cuda9.0
py2                      /home/tsq/anaconda2/envs/py2
torch0.4                 /home/tsq/anaconda2/envs/torch0.4
tsqPy2                   /home/tsq/anaconda2/envs/tsqPy2
tsqPy3                   /home/tsq/anaconda2/envs/tsqPy3
  • step2. 删除旧环境
conda remove -n tsqPy2 --all

你可能感兴趣的:(Python学习)