conda

Conda Installation

  • follow the instructions on the official website: link

Conda Environment Management

  1. create a new environment named conda_name
    conda create --name conda_name
  2. activate the environment
    conda activate conda_name
  3. to see list of alll your environments
    conda info --envs or conda env list
  4. create the environment from environment.yaml file
    conda env create -f environment.yml
  5. clone an environment
    conda create --name myclone --clone mysource
  6. update environment
    conda env update --file local.yml

Conda Package Management

  1. find a package
    conda search package_name
  2. install package
    conda install package_name or conda install -n envname package_name=0.15.0 or conda install --prefix=~/env pytorch
  3. to see the packages installed in the environment
    conda list

Export Conda Environment to yaml file

conda env export > environment.yml

Remove Conda Environment

conda remove --name myenv --all

Conda Add Channels

conda config --show channels
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes