conda环境复制

envs

conda_install_path = "~/anaconda3"

打包pkgs和envs

  1. cd conda_install_path
  2. tar -czvf pkgs.tar.gz ./pkgs
  3. cd ./envs
  4. tar -czvf py37torch.tar.gz ./py37torch

安装conda

  1. rm -rf conda_install_path
  2. ./conda_install.sh -b -p $conda_install_path

替换pkgs

  1. rm -rf $conda_install_path/pkgs
  2. tar xvf pkgs.tar.gz
  3. mv pkgs $conda_install_path

替换envs

  1. mkdir py37torch
  2. tar xvf py37torch.tar.gz -C py37torch
  3. source $conda_install_path/bin/activate
  4. rm -rf $conda_install_path/env/py37torch
  5. conda create -n py37torch --clone ./py37torch
  6. rm -rf ./py37torch

你可能感兴趣的:(tools,ubuntu,python,conda,python,linux)