conda create -n <env-name>
conda create -n <env-name> python=<version>
- 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
conda env remove -n <env-name>
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 search <package-name>
conda update <package-name>
- Update all packages in environment
conda remove <package-name>
conda activate <env-name>
- Clone existing environment
conda create --name <new-env> --clone <old-env>
- Check environment details
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
- Run Python script inside environment
conda run -n <env-name> python <script.py>
- Check for updates to conda itself