之前修改bash_profile檔案導緻anaconda的終端啟動時出現,“程序已完成”。網上查詢後發現一般出現“程序已完成”的情況時,bash_profile沒有配置對,是以找到bash_profile檔案,進行修改環境變量。
在終端輸入指令
轉到home目錄:
$ cd ~
打開bash_profile檔案
$ open .bash_profile
出現bash_profile的文本檔案
添加anaconda的環境變量
# added by Anaconda3 5.3.0 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<
儲存檔案然後source
source .bash_profile