1、鏡像下載安裝包
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
如果之前沒有安裝過wget,則會報錯如下使用如下語句安裝wget
yum install wget
2、安裝miniconda3
bash Miniconda3-latest-Linux-x86_64.sh
之后,按照指示輸入一次回車,接受協議,遇到選擇yes就可以,就可以安裝好了
3.查看是否加到環境變量
vim /root/.bashrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/root/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/root/miniconda3/etc/profile.d/conda.sh" ]; then
. "/root/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/root/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
重啟環境變量
source /root/.bashrc
檢查
conda -V
但conda默認的不是使用鏡像,所以這里要設置一下
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
設置完之后,可以使用以下指令看一下是否設置好了
conda info