Move environments from anaconda to mamba forge?

302 views Asked by At

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?

3

There are 3 answers

0
Alex Mkwizu 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

0
maddes8cht 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
0
maddes8cht On

Conda and mamba are very delicate species.

I wouldn't even recomend to rename an environment with the nowadays available conda rename command. 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 after conda rename that 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 export the requirements etc. and use them).

So, there might be ways that sometimes might work, but don't expect that

  • a way that worked on one env will also work on your others
  • the whole process with different environments will spare you time compared to simply rebuilding the environments.

Setting up environments in a fast way is where conda / mamba shines, 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.