linux安装miniconda3
2021-10-08 本文已影响0人
后知不觉1
1、下载安装包
https://docs.conda.io/en/latest/miniconda.html
wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh
2、执行安装
bash Miniconda3-latest-Linux-x86_64.sh
一直"enter,然后按照指引操作"

3、执行初始化
3.1、自动执行初始化选择yes

3.2、手动初始化
#进入安装目录
cd $instatll/miniconda3/
condabin/conda init
source ~/.bashrc
4、检验
conda activate ###激活虚拟python3环境
python --version
5、troubleshooting
针对调度进程使用python3环境,需先手动启用python环境需要加执行命令
source /root/.bashrc #这种要授权
如无法授权可以在脚本前手动执行激活python3环境
__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