0

There seem to be other similar questions, but none that seem to be exactly this.

I have created a conda install on a machine. I want to create the exact same install on a 2nd machine. I could export the environment and then create an environment using that exported information. But in all the examples, I'm creating an environment that is a clone of the root. Not a new root that is a clone of the root.

So how to I create a true clone of a conda install? The idea would be

  1. Export the environment of the root on machine 1 conda [something...] > configuration.yml

  2. Install miniconda using Miniconda....sh on machine 2

  3. Recreate the original environment conda [install all the stuff including enironments] configuration.yml

I can't seem to find any explicit instructions for doing this. The closest I found suggests:

conda env export > environment.yml              
conda env update -n root -f environment.yml   

However the first command draws an error:

balter@server:/home/.../Applications$ conda env export > environment.yml


CondaEnvException: Conda Env Exception: Unable to determine environment

Please re-run this command with one of the following options:

* Provide an environment name via --name or -n
* Re-run this command inside an activated conda environment.


balter@server:/home/.../Applications$ conda -h
usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

...
...

One of the posts I found on the interwebs discusses two points that I'm unclear about:

1) Whether pip installs also carry over, and 2) The difference between

conda env create

and

conda create
Community
  • 1
  • 1
abalter
  • 9,663
  • 17
  • 90
  • 145
  • The first error seems pretty clear... provide a name for the environment you want to export, e.g., `root`. – darthbith Mar 07 '17 at 21:17
  • Yes, that does work. However, even the docs say that what I typed should work. Try typing `conda env export -h`. The two examples given are exactly what I have in my post. – abalter Mar 08 '17 at 03:37

1 Answers1

4

Conda environments exist as an easy solution to this sort of problem. However, it is possible to do what you ask.

Step 1: confirm you are in the root environment on the first machine, then export a list of the installed packages:

$ source activate root
$ conda list -e > root.yml

Step 2: on the other machine, download and install Miniconda, then install the packages from root.yml:

$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh
$ conda install --file root.yml
Community
  • 1
  • 1
harryscholes
  • 1,617
  • 16
  • 18
  • Oh golly, that is simple. I know all the steps except for the last! I didn't know that conda could install from a file created by conda list. – abalter Mar 08 '17 at 03:35