Is there an easy way to move existing conda environments to a new install of mamba forge? Or do they all have to be recreated from scratch?
Move environments from anaconda to mamba forge?
353 Views Asked by beginner_ AtThere are 3 best solutions below
On
If you have Anaconda-Navigator and an Anaconda-Nucleusaccount, you can use the Backup function in the Anaconda-Navigator environment section to Backup an environment to Anaconda-Nucleus and Import it on another machine with Anaconda-Navigator.
I don't know what or how they do it, but the result for me is definitve different from conda env export, as I have environments that didn't turn out the same with conda env export and conda create --file (or couldn't be recreated at all without manual editing the yaml-file) , while they worked with this backup function.
On Anaconda-Navigator:
You can install Anaconda-Navigator in a pure Mamba installation in a seperate environment to seperate it from your base env. Use
mamba create -n anaconda-navigator anaconda-navigator -c anaconda
On
moving conda environments to mamba forge ( miniforge ) is risky and most likely to cause conflicts.
I think you are shifting to mamba because it is fast in resolving dependencies.
You can now use lib-mamba resolver to achieve the same effect.
conda activate
conda update -n base conda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
Full article : https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community
Conda and mamba are very delicate species.
I wouldn't even recomend to rename an environment with the nowadays available
conda renamecommand. While i have seen that it may work and result in an usable environment after the rename, it is still very common to have a non-functional environment afterconda renamethat doesen't get functional again when renaming it back to it's initial name.Instead of even trying, most of the time it would have been easier to just rebuild the whole environment from scratch with the new intended name (of course you may
exportthe requirements etc. and use them).So, there might be ways that sometimes might work, but don't expect that
Setting up environments in a fast way is where
conda/mambashines, so simply do it.I would be glad to have working rename and similar functions in
conda/mamba, but we are still far away from that.