I would like to copy a conda environment under a different name.
I have a conda environment that I like. I would like to create a new environment with a copy so that I can make some experimental edits. In git
parlance I'm looking for branch
or checkout -b
.
Does such a branch
or fork
feature exist in conda?
If not what is the best workaround today?
Create the environment from the environment.yml file: conda env create -f environment.yml The first line of the yml file sets the new environment's name. For details see Creating an environment file manually.
This setting controls whether or not conda activates your base environment when it first starts up. You'll have the conda command available either way, but without activating the environment, none of the other programs in the environment will be available until the environment is activated with conda activate base.
Conda is a package manager and a virtual environment and it provides the convenience of allowing you to manage what version of Python the virtual environment (and as a result your project) uses as well. So naturally, conda is very convenient and I use it my projects as well. How to use conda environment?
Conda environments ¶ A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected.
the above (export|create) information still works, but is out of date now, conda
now has a CLONE option:
conda create --clone <existing enviroment> -n <new environment>
You can create a copy of the environment by using conda env export > environment.yml
on all platforms and then activate that env with conda env create -f environment.yml
. Make your desired changes and when you want to revert then activate your orginal environment.
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