Reproducible conda environments¶
How to export an environment?¶
You can export an environment as an yaml file that contains the list of packages installed in this environment with the following command:
Mixed environments
Only packages installed with conda or pip are taken in account.
If you have installed, for example, some R packages without using conda, please use Renv to manage them.
Resilience
Some packages are sometime deindexed from channels. They always exist but are tagged as unavailable, rendering the environment unable to be reinstalled from the yaml file.
Some alternatives manage this problem:
How to import an environment?¶
You can restore or install an environment from an yaml file <env-file.yml> with the conda env create command:
Environment name
If you forget the option -p (or -n), the environment will be created at ~/.conda/envs/<env>, where <env> is the name of the environment defined into file <env-file.yml>.