Option 1 - YAML file
When trying to import packages from the second environment to the root environment:
In the second environment, export the package names to the yaml file:
> conda env export > environment.yml
then update the first environment (see suggestion below):
> conda env update -n root -f envoronment.yml
See also conda env
for more details. Alternatively, check out the included Anaconada Navigator desktop software for more clarity.
Suggestion: make a backup of existing environments (see the first command) before attempting to make root changes and verify the desired result by testing these commands in a demo environment.
Option 2 - cloning medium
The --clone
flag can be used to clone environments:
> conda create --name myclone --clone root
This basically creates a direct copy of the environment.
Option 3 - Spec file
You can also create a specification file to add dependencies from one environment to another:
> conda list --explicit > spec-file.txt > conda install --name root --file spec-file.txt
Alternatively, copyable media (similar to cloning):
> conda create --name myenv --file spec-file.txt
Note. Spec files only work with environments created in the same OS.
source share