linux 离线安装、迁移 Anaconda环境
1.从A服务器打包安装目录
2.上传到B服务器相同目录
3.配置
vi ~./bashrc 添加如下配置 # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/miniconda3/etc/profile.d/conda.sh" ]; then . "/home/miniconda3/etc/profile.d/conda.sh" else export PATH="/home/miniconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< EOF #重新载入配置 source ~./bashrc
4.环境命令说明
# 查看已安装的python环境 conda info -e #conda info --envs conda env list #激活环境 source ~/.bashrc(后接环境名,不加默认为base) source activate test #退出环境 source deactivate test