The conda environment:#

Conda is an open-source package management system and environment management system that runs on Windows, macOS, and Linux. Conda quickly installs, runs, and updates packages and their dependencies. Conda easily creates, saves, loads, and switches between environments on your local computer. It was created for Python programs but it can package and distribute software for any language.

Be aware that when we activate a conda environment the terminal now is running through that python kernel.

Some useful commands:

  • Info about the conda install:

(esgf-pyclient) $ conda info

        active environment : esgf-pyclient
...
            python version : 3.7.8.final.0
...
    active env location : /home/dkrz/<username>/.conda/envs/esgf-pyclient
        user config file : /home/dkrz/<username>/.condarc
...
base environment : /sw/spack-rhel6/anaconda3-2020.02-dqbodz  (read only)
...
            package cache : /sw/spack-rhel6/anaconda3-2020.02-dqbodz/pkgs
                            /home/dkrz/<username>/.conda/pkgs
        envs directories : /home/dkrz/<username>/.conda/envs
                            /sw/spack-rhel6/anaconda3-2020.02-dqbodz/envs
...
  • show all the installed packages within the environment:

(esgf-pyclient) $ conda list
# packages in environment at /home/dkrz/<username>/.conda/envs/esgf-pyclient:
#
# Name                    Version                   Build  Channel
...
defusedxml                0.6.0                    pypi_0    pypi
esgf-pyclient             0.3.0              pyh44b312d_0    conda-forge
...
myproxyclient             2.1.0                    pypi_0    pyp
...
  • specific path of each package:

(esgf-pyclient) $ pip show defusedxml
Name: defusedxml
Version: 0.6.0
Summary: XML bomb protection for Python stdlib modules
Home-page: https:%%//%%github.com/tiran/defusedxml
Author: Christian Heimes
Author-email: christian@python.org
License: PSFL
Location: /path/to/<username>/.conda/envs/esgf-pyclient/lib/python3.9/site-packages
Requires: Required-by: esgf-pyclient
  • show all the available conda environments:

$ conda env list
# conda environments:
#
esgf-pyclient            /home/dkrz/<username>/.conda/envs/esgf-pyclient
base                  *  /sw/spack-rhel6/anaconda3-2020.02-dqbodz
  • exit the conda environment(s):

(esgf-pyclient) $ conda deactivate
(base) $ conda deactivate
$