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

 

posted on 2021-06-08 14:51  李漂亮  阅读(3945)  评论(0编辑  收藏  举报