如何为默认的anaconda添加别名?
How to add an alias name for the default anaconda ?
如下图所示,我默认的Anaconda环境(anaconda3)没有名字。
此外,我想将 Anaconda3 设置为我的默认 python 环境。
我也在我的 ~/.bashrc 文件中找到了这个。
# added by Anaconda3 4.4.0 installer
export PATH="/home/cine/anaconda3/bin:$PATH"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/cine/anaconda2/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/cine/anaconda2/etc/profile.d/conda.sh" ]; then
. "/home/cine/anaconda2/etc/profile.d/conda.sh"
else
export PATH="/home/cine/anaconda2/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
怎么办?
您必须在默认 .rc file
中包含 PATH
变量。一个简单的解决方法就是添加
export PATH="/home/username/anaconda3/bin:$PATH"
到您的 ~/.profile
文件。然后通过 运行
获取文件
source ~/.profile
在终端中。
通过 运行
验证它是否有效
which python
你应该看到 /home/username/anaconda3/bin/python
如下图所示,我默认的Anaconda环境(anaconda3)没有名字。
此外,我想将 Anaconda3 设置为我的默认 python 环境。
我也在我的 ~/.bashrc 文件中找到了这个。
# added by Anaconda3 4.4.0 installer
export PATH="/home/cine/anaconda3/bin:$PATH"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/cine/anaconda2/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/cine/anaconda2/etc/profile.d/conda.sh" ]; then
. "/home/cine/anaconda2/etc/profile.d/conda.sh"
else
export PATH="/home/cine/anaconda2/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
怎么办?
您必须在默认 .rc file
中包含 PATH
变量。一个简单的解决方法就是添加
export PATH="/home/username/anaconda3/bin:$PATH"
到您的 ~/.profile
文件。然后通过 运行
source ~/.profile
在终端中。
通过 运行
验证它是否有效which python
你应该看到 /home/username/anaconda3/bin/python