'conda create --clone v.s. copying the environment directly
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.
How is conda create --clone different from copying the environment directory directly into new location?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
