Conda Recipes

neotam Avatar

Conda Recipes
Posted on :

Tags :

Conda is the language agnostic, cross platform package management and environment management system. We can install it stand alone

Verify the Conda installation

conda info

#To update conda
conda update conda 

Package Installation and update

conda install PACKAGENAME  #Install Package
conda update PACKAGENAME  #Update Package

How to Create Conda Virtual Environment

Create different python environments

Create Environment

conda create --name envpy2 python=2.7

for python3

conda create --name envpy3 python=3.9

Working with Environment

To clone theenvironment

conda create --clone ENVNAME -n NEW_ENV

To Rename the enironment

conda rename -n ENVNAME ENV_ENV_NAME 

To delete the environment

conda remove -n ENVNAME --all

To list the revisions made to environment

conda list -n ENVNAME --revisions 

Activate or Deactivate Env

Switch Between Environments

activate the environment (Linux/Mac)

conda activate envpy3

for windows

activate envpy3

Deactivate the environment (Linux/Mac)

conda deactivate

for windows


Same, way activate and deactivate to switch between different environments


List Environments

conda env list 

List all packages installed with version in the current environment

conda list 

List the installed packages with source information

conda list --show-channel-urls 

List the history of changes

conda list --revisions 

Installing Packages

To get information on package

conda search PKGNAME --info 

Install the package

conda install PACKAGE

To install the package to particular environment

conda install -n ENVNAME PACKAGE1 PACKAGE2 --yes

To install the package of specific version

conda install PKGNAME=2.14.2

conda install "PKGNAME>1.5,<2.5"  #Install package with AND logic
conda install "PKGNAME [version='1.5|4.4']". #Install package with OR logic
conda install CHANNELNAME::PKGNAME  #Install package from specific channel
conda install -c CHANNELANME PKG1 PKG2 

To Remove the package

conda uninstall PACKAGE -n ENVNAME

Update all packages in specific environment

conda update --all -n ENVNAME

Leave a Reply

Your email address will not be published. Required fields are marked *