https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
I understand that
You can make an exact copy of an environment by creating a clone of it:
conda create --name myclone --clone myenv
where myenv
is an existing environment.
conda create --clone
different from copying the environment directory directly into new location?Conda maintains hardlinks to reduce physical disk usage. Normal copying will simply make physical duplicates, wasting a bunch of space unnecessarily.
The most problematic issue is that of files that include absolute paths. Copying alone would result in coupling to the original environment in a cryptic way. This could lead to changes in the original environment implicitly affecting the copied one. There is the conda-prefix-replacement
tool for use in rewiring these absolute links.1
Lastly, there are also packages that run post-link installation scripts. Copying wouldn't be running these, which could lead to undefined behavior.
[1]: An historical note might be of interest to some - especially for this oh-so-appropriately named piece of software. This tool (cpr
) arose from a major breakage in Anaconda when MacOS users upgraded to Catalina (10.15) (see blog post). Older installers of Anaconda would sometimes use /anaconda
as the installation directory, but Apple made creating folders in system volume root off-limits in MacOS 10.15. This resulted in users' Anaconda installations getting moved during the upgrade, and ultimately breaking them. The cpr
tool thus provided a mean of resuscitating these incapacitated Conda installations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With