title: Activate conda environment inside Singularity container
body: <p>So, I guess this is done in a really simple way, but I do not have experience with it, so I do not understand what is the issue. Let's say I have a conda environment <code>example_env</code> and a Singularity image <code>example.simg</code>.</p>
  <p>I can run the image:
  <code>singularity run --nv /mnt/appl/singularity_images/pytorch-19.03-py3.simg</code></p>
  <p>Once I am in the Singularity container, I can write <code>conda activate example_env</code>, and it works for me without any problem.</p>
  <p>Now, I want to switch from the interactive section to a script. So, instead of using <code>singularity run</code> and entering the interactive shell, I have tried <code>singularity exec</code>: <code>singularity exec example.simg bash scripts/train.sh</code>, where <code>train.sh</code> contains only one (just for now, of course) command: <code>conda activate example_env</code>.</p>
  <p>However, now it does not work, and gives me the following error: <code>CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. To initialize your shell, run $ conda init &lt;SHELL_NAME&gt;</code> If I try to follow the error message, and add the <code>conda init</code> command, it does not help.</p>
  <p>What is wrong, and how can I run <code>conda activate</code> with <code>singularity exec</code>?</p>