1.下载Anaconda
anaconda官网
这里我们选择Linux系统版本,Anaconda为Python3.8版本
点击下载即可Anaconda3-2020.07-Linux-x86_64.sh
2. 上传到linux 服务器
# 进入Anaconda3-2020.07-Linux-x86_64.sh所在目录
cd /opt
# 执行安装脚本
sh ./Anaconda3-2020.07-Linux-x86_64.sh
一路next即可
默认会自动配置环境变量cat ~/.bashrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
若没有自动配置,可以手动执行/opt/anaconda3/etc/profile.d/conda.sh这个脚本
也可手动配置环境变量
vim ~/.bash_profile
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/opt/anaconda3/bin
# 立即生效
source ~/.bash_profile
# 查看conda版本
conda -V