How to export a conda environment (not the yml file but all the binaries so conda doesn't solve anything)

50 Views Asked by At

The question

With miniconda, miniforge or Mambaforge (not Anaconda), is there a way to export an environment you have created with conda/mamba? I do not mean exporting a yml file, I mean exporting all the binaries.

Why I'm asking it

I am well aware that you can export a yml file with all the details of the environment. However, that still requires conda or mamba to solve that environment. I need to restore these environments on a PC which is relatively slow and which takes a while to create environments from yml files. Also, this PC is behind a proxy with which the slow conda works, but the fast mamba does not. That is not an isolated issue and has been reported on github, too. The bottleneck is not downloading the packages but waiting for conda to solve the environment. On PCs which are faster and/or on which mamba works this would be a non-issue.

What I'm trying to achieve

I'd like to be able to tell conda: look, all you need to create my environment is here in this file, just restore the backup, and don't let me wait ages for conda to solve the environment.

What I'm not asking

To be absolutely clear and to avoid i) answers which may not be relevant and ii) people mistaking this question for something else and closing this question, I would like to clarify that I am NOT asking any of the following:

  1. How to make conda faster. In fact, I myself provided an answer on that very topic https://stackoverflow.com/a/75929105/4045275
  2. How to configure mamba
  3. How to export into a yml file (see above)

What I have found so far

There are some posts on how to set up a local channel https://stackoverflow.com/a/56284359/4045275 but, if I understand correctly, that doesn't skip the "conda taking forever to solve" problem

There is an answer to this question: How to transfer a conda environment to an off-line computer about how to install an environment when you don't have access to the internet. That is not my question.

Someone suggested conda-lock. I have tried it, it is painfully slow, the documentation is awful, but most of all it doesn't work - it keeps failing with weird errors I don't understand.

0

There are 0 best solutions below