Sharing a conda based install

I’m looking to use the new conda installer at Harvard. I am hoping to create a shared installation, but I’m not certain that is the best plan. Does anyone have any experience sharing a conda environment? I noticed that when I installed lsst-distrib into a clone of our anaconda installation, the is stored in my $HOME directory. Perhaps it’s my ignorance about conda environments, is there a way around that? I could just copy the file elsewhere. However, I’m wondering if there are other home directory bits that other users will not have if I point them to this conda environment, even if I create the conda environment in a shared area via the --prefix option. Alternatively, I could export the environment via “conda env export”, and have each user use that file to setup lsst-distrib for themselves.
Maybe I should avoid cloning the anaconda environment and install lsst-distrib in the anaconda installation area… yes that seems to help. I should probably avoid cloning the environment and just install into our anaconda installation.
I was hoping to avoid that, since I already installed an earlier version of DMstack using this particular anaconda installation. I’m assuming due to the updates to some of the underlying packages like numpy and python itself - that this new install would mean my previous DMstack (v10_1) build is relying on a now invalid set of python packages. I could just have multiple anaconda (or miniconda) installations I suppose.

Hi @heather999,

I believe conda supports shared environments. E.g., assuming you’re user foo (who can write to where the stack is), this should work:

export PATH="/where/my/conda/is:$PATH"
conda config --add channels
conda create -n lsst-v11 lsst-distrib

The last line will create a new conda environment named “lsst-v11”, with the v11 version of the stack.

Now, if any other user should be able to say:

export PATH="/where/my/conda/is:$PATH"
source activate lsst-v11

to get the stack onto their path. This way you also won’t interfere with any other installation of the stack (or anything else) that is in your conda root environment (or any other environments you may have) – conda environments are fully isolated from each other. Does this appear to solve your problem?

Hmm, that shouldn’t happen – should end up in the bin/ subdirectory of your environment. Is this problem reproducible?

Hi @mjuric,
Yes, your instructions worked perfectly - of course! I will see if I can reproduce the problem I was having. I was creating the conda environment, activating it, and then trying to add lsst-distrib to that new area via “conda install lsst-distrib”. That might explain the behavior I was seeing. didn’t exist anywhere but in my $HOME area, in that case. I’ll see if I can reproduce it and provide a full list of the commands I executed.

OK, no worries. Btw., what you did seems OK as well – i.e., my instructions above are really a shorthand for:

export PATH="/where/my/conda/is:$PATH"
conda config --add channels

conda create -n lsst-v11 python
source activate lsst-v11
conda install lsst-distrib
source deactivate lsst-v11

(where the last four lines effectively get collapsed to one, if you ask conda to immediately install lsst-distrib when it’s creating the environment). I’ve never used environments created with --prefix; I wonder if there’s a bug somewhere in those (either in our build code, or in conda itself).

I failed miserably to reproduce that :slight_smile: I’m not sure what happened the first time, clearly I did something wrong :smile:
Thanks for the help - we seem to be up and running now.