Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Goal: Introduce how conda environments can be shared.

Table of Contents
stylenone

...

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.
...

Example

Code Block
[salexan5@mblog2 software]$ conda create -p py_env2 --clone py_env
Retrieving notices: ...working... done
Source:      /home/salexan5/.conda/envs/py_env
Destination: /cluster/medbow/project/arcc/salexan5/software/py_env2
Packages: 39
Files: 1
...
#
# To activate this environment, use
#     $ conda activate /cluster/medbow/project/arcc/salexan5/software/py_env2
Expand
titleFull Details:
Code Block
[salexan5@mblog2 software]$ pwd
/project/arcc/salexan5/software
[salexan5@mblog2 software]$ ls
slim_env_4.2.2

[salexan5@mblog2 software]$ conda create -p py_env2 --clone py_env
Retrieving notices: ...working... done
Source:      /home/salexan5/.conda/envs/py_env
Destination: /cluster/medbow/project/arcc/salexan5/software/py_env2
Packages: 39
Files: 1

Downloading and Extracting Packages:


Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate /cluster/medbow/project/arcc/salexan5/software/py_env2
#
# To deactivate an active environment, use
#
#     $ conda deactivate


[salexan5@mblog2 software]$ ls
py_env2  slim_env_4.2.2

...

Using Cloned Environment

Note

Notice how you need to activate/use this cloned environment:

Code Block
[salexan5@mblog2 ~]$ cat ~/.conda/environments.txt
/home/salexan5/.conda/envs/py_env
/project/arcc/salexan5/conda/envs/r_env
/cluster/medbow/project/arcc/salexan5/software/slim_env_4.2.2
/cluster/medbow/project/arcc/salexan5/software/py_env2


[salexan5@mblog2 ~]$ conda info --env
# conda environments:
#
base                     /apps/u/opt/linux/miniconda3/24.3.0
                         /cluster/medbow/project/arcc/salexan5/software/py_env2
                         /cluster/medbow/project/arcc/salexan5/software/slim_env_4.2.2
py_env                   /home/salexan5/.conda/envs/py_env
r_env                    /project/arcc/salexan5/conda/envs/r_env
Info

Need to define the full path to activate.

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

...

Import an Environment

Code Block

...

...