Skip to content

Instantly share code, notes, and snippets.

@rendicahya
Last active August 16, 2025 14:01
Show Gist options
  • Save rendicahya/1e2a65a6cd5d7ebabf130f74d49dc7da to your computer and use it in GitHub Desktop.
Save rendicahya/1e2a65a6cd5d7ebabf130f74d49dc7da to your computer and use it in GitHub Desktop.

Conda Cheatsheet

Project Management

  • Create new environment
conda create -n <env-name>
conda create -n <env-name> python=<version>
  • List all environments
conda env list
  • Export environment to YAML
conda export --format=environment-yaml
  • Create environment from YAML
conda env create -n <env-name> --file environment.yml
  • Update environment from YAML
conda env update -f environment.yml --prune
  • Remove environment
conda env remove -n <env-name>

Dependency Management

  • Install package
conda install <package-name>
conda install <package-name>=<version>
  • Install from specific channel (e.g., conda-forge, pytorch)
conda install -c <channel> <package-name>
  • Install multiple packages
conda install numpy pandas matplotlib
  • List all installed packages
conda list
  • Search for package
conda search <package-name>
  • Update package
conda update <package-name>
  • Update all packages in environment
conda update --all
  • Remove package
conda remove <package-name>

Virtual Environments

  • Activate environment
conda activate <env-name>
  • Deactivate environment
conda deactivate
  • Clone existing environment
conda create --name <new-env> --clone <old-env>
  • Check environment details
conda info

Channels & Config

  • List configured channels
conda config --show channels
  • Add a channel (e.g., conda-forge)
conda config --add channels conda-forge
  • Set channel priority (strict/soft)
conda config --set channel_priority strict
  • View current configuration
conda config --show

Miscellaneous

  • Run Python script inside environment
conda run -n <env-name> python <script.py>
  • Clean package cache
conda clean --all
  • Check for updates to conda itself
conda update conda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment