Conda Cheat Sheet

  1. 新建虚拟环境

    1
    2
    conda create --name my_env_name [python=3.9] # Create the environment from scratch
    conda env create -f environment.yml # Create the environment from the environment.yml file
  2. 列出所有虚拟环境

    1
    conda env list
  3. 激活虚拟环境

    1
    conda activate my_env_name
  4. 查看虚拟环境内安装包

    1
    2
    conda list -n my_env_name # deactivated
    conda list # activated
  5. 导出虚拟环境

    1
    conda env export > environment.yml 
  6. 重建虚拟环境

    1
    conda env create -f environment.yml