Goal: Introduce how conda environments can be shared.
Based on Managing Environments.
Table of Contents | ||
---|---|---|
|
...
Clone an Environment
Code Block |
---|
[salexan5@mblog2 ~]$ conda create --help ... options: ... --clone ENV Create a new environment as a copy of an existing local environment. ... |
...
Code Block |
---|
[salexan5@mblog2 ~]$ conda activate /cluster/medbow/project/arcc/salexan5/software/py_env2 (/cluster/medbow/project/arcc/salexan5/software/py_env2) [salexan5@mblog2 ~]$ |
...
Export an Environment
Code Block |
---|
[salexan5@mblog2 ~]$ conda activate r_env
(r_env) [salexan5@mblog2 ~]$ conda env export > r_env.yml
(r_env) [salexan5@mblog2 ~]$ conda deactivate
[salexan5@mblog2 ~]$ cat r_env.yml
name: r_env
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=main
...
- zstd=1.5.5=hc292b87_2
prefix: /project/arcc/salexan5/conda/envs/r_env |
...
Conda env command
Code Block |
---|
[salexan5@mblog2 ~]$ conda env --help
usage: conda env [-h] command ...
positional arguments:
command
config Configure a conda environment.
create Create an environment based on an environment definition file.
export Export a given environment
list List the Conda environments.
remove Remove an environment.
update Update the current environment based on environment file.
options:
-h, --help Show this help message and exit. |
...
Import an Environment
Code Block |
---|
[salexan5@mblog2 software]$ conda env create -p r_env2 --file r_env.yml
...
#
# To activate this environment, use
#
# $ conda activate /cluster/medbow/project/arcc/salexan5/software/r_env2
... |
...
...