Conda Cheat Sheet 4.8



Sources:

  1. Conda Cheat Sheet 4.7
  2. Conda Cheat Sheet 4.80
  3. Conda Cheat Sheet 4.8 Pdf

The photos you provided may be used to improve Bing image processing services. Victoriaodell on Conda 4.4 Cheat Sheet. Now in this phase for the cheatsheet: Review Review for design errors only. (Rory) OPTIONAL: Fixing errors from the design phase (Alex) Final Review Final review (Kerry, Christine, Rory; Janice to do OK to print) (We should only be correcting actual errors at.

Package, dependency and environment management for any language

Conda

Conda Cheat Sheet 4.7

Create software environments for development and execution in a reproducible way.

For the smallest footprint, install Miniconda,which is just the Conda package manager and Python:

Define Conda environments

Create a YAML file, e.g., my-dev-env.yml as follows: Nfs carbon repack.

(default channel listed to be explicit, can be omitted)

Create Conda environments

conda env create -f <FILENAME>

conda env create -f my-dev-env.yml

(De-)activate Conda environment

conda activate <ENV-NAME>

conda activate my-dev-env

conda deactivate my-dev-env

Search for packages

conda search <PKG-NAME> searches whatever channels are configured (at least, that is the default channel)

conda search --channel <CHANNEL-NAME> <PKG-NAME> searches the packagealso in the specified channel

Add channels

conda config --add channels <CHANNEL-NAME>

Update a Conda environment

Same as: install new packages into environment.Update the YAML file, e.g.,

Update the environment: conda env update -f my-dev-env.yml

Remove an environment

Conda Cheat Sheet 4.80

conda env remove --name <ENV-NAME>

Remove package from environment

Uninstall package: conda remove --name <ENV-NAME> <PKG-NAME>

Install packages via pip

Conda Cheat Sheet 4.8 Pdf

Specify install command in the YAML file as follows:

For the git repo case, this installs the master branch. To install a specific branch, change as follows:

Export Conda environment specification

Why could this be important? Specifying (“pinning”) package versions prevents a change/updateof said package, BUT other packages/libraries not specifically listed in the YAML file cannevertheless be changed during conda env update. In the worst case, this may break something.

As soon as the work performed in the Conda environment reaches a certain level ofmaturity (e.g., dependencies no longer change), one can export a more comprehensivespecification of the respective Conda environment viaconda env export --name ENV-NAME > my-dev-env.yml. Obviously, this will overwritemy-dev-env.yml.

Setting environment variables

In the top-level directory of the Conda environment (/envs/my-dev-env/),create the following files and folders:

Edit ./etc/conda/activate.d/env_vars.sh as follows:

Edit ./etc/conda/deactivate.d/env_vars.sh as follows:

NB: Preferred way for handling stuff such as LD_LIBRARY_PATH etc.