https://docs.conda.io/en/latest/miniconda.html
wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
一直"enter,然后按照指引操作"
image.png
image.png
#进入安装目录
cd $instatll/miniconda3/
condabin/conda init
source ~/.bashrc
conda activate ###激活虚拟python3环境
python --version
conda deactivate ###退出虚拟python3环境
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
也可以通过直接创建软连
ln -s /data1/miniconda3/bin/python /usr/bin/python3
服务连上互联网
conda
conda create -n your_env_name python=x.x
#demo,会自动联网下载包放到$conda/env
conda create -n mypython python=2.7.5
创建环境变量
ln -s /root/miniconda3/envs/test_py2/bin/python /usr/bin/python2
scp $install_home/miniconda3 hosts:/$install_home
ssh hosts
$install_home:/condbin/conda init
source ~/.bashrc