当我跑步时:
源激活/ anaconda2 / envs / myEnv
它在我的提示下(在iterm2上)显示了此conda环境的整个目录,如下所示:
(/Users/billy/anaconda2/envs/myEnv)billy@mbp:~/projects
这是一种缩短此方法的方法,以便仅显示conda环境的名称,而不显示整个目录吗?例如:
(myEnv)billy@mbp:~/projects
谢谢。
您可以尝试以下方法:
确保在命令的输出/anaconda2/envs
部分envs_dirs
中列出了该命令:
$ conda config --show
如果不存在,则可以这样添加:
$ conda config --add envs_dirs /anaconda2/envs
然后,像这样激活环境:
$ source activate myEnv
例:
(root) ~/condaexpts ??? conda create -yp /tmp/miniconda2/myEnv Fetching package metadata ....... .Solving package specifications: . Package plan for installation in environment /tmp/miniconda2/myEnv: The following empty environments will be CREATED: /tmp/miniconda2/myEnv # # To activate this environment, use: # > source activate /tmp/miniconda2/myEnv # # To deactivate this environment, use: # > source deactivate /tmp/miniconda2/myEnv # (root) ~/condaexpts ??? conda config --add envs_dirs /tmp/miniconda2 (root) ~/condaexpts ??? source activate myEnv (myEnv) ~/condaexpts ???