title: Can't activate conda env from shell script
body: <p>I've tried everything I've seen on SO to get this to work, but so far everything fails. Using macOS Big Sur 11.6, bash in Terminal (not zsh).</p>
  <p>I'm trying to create a setup file and execute with <code>sh setup.sh</code> that will setup the env, install python, and then activate it. Nothing fancy. Doing it manually works fine, but once I put it in a shell script, it won't work. I'm running this script from inside an empty project folder.</p>
  <p>Current script:</p>
  <pre class="lang-sh prettyprint-override"><code>conda create -n MASTER python=3.8.5 -y
  
  conda activate MASTER
  </code></pre>
  <p>Yeah, it's that simple to start with. I commented out the other pip installs until this works properly.</p>
  <p>I tried running: <code>bash -i setup.sh</code> but it still does not activate. I get no errors but I'm still stuck in <code>(base)</code>.</p>
  <p>I tried using source: <code>source /opt/anaconda3/etc/profile.d/conda.sh</code> at beginning of script and/or before activate, still doesn't work. No errors again, but stuck in <code>(base)</code>.</p>
  <p>I tried using: <code>eval $(conda shell.bash hook)</code> at the start of script and before I try to activate the env, but it fails. This time I get the error:</p>
  <pre class="lang-sh prettyprint-override"><code>CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
  To initialize your shell, run
  
      $ conda init &lt;SHELL_NAME&gt;
  
  Currently supported shells are:
    - bash
    - fish
    - tcsh
    - xonsh
    - zsh
    - powershell
  </code></pre>
  <p>But if I run <code>conda init bash</code> (in Terminal or in the script itself), it outputs:</p>
  <pre class="lang-sh prettyprint-override"><code>no change     /opt/anaconda3/condabin/conda
  no change     /opt/anaconda3/bin/conda
  no change     /opt/anaconda3/bin/conda-env
  no change     /opt/anaconda3/bin/activate
  no change     /opt/anaconda3/bin/deactivate
  no change     /opt/anaconda3/etc/profile.d/conda.sh
  no change     /opt/anaconda3/etc/fish/conf.d/conda.fish
  no change     /opt/anaconda3/shell/condabin/Conda.psm1
  no change     /opt/anaconda3/shell/condabin/conda-hook.ps1
  no change     /opt/anaconda3/lib/python3.8/site-packages/xontrib/conda.xsh
  no change     /opt/anaconda3/etc/profile.d/conda.csh
  no change     /Users/liquidRock/.bash_profile
  No action taken.
  </code></pre>
  <p>I tried doing <code>/opt/anaconda3/bin/conda activate MASTER</code> which also prompts me to do <code>conda init bash</code>.</p>
  <p>Even tried adding <code>#!/bin/bash</code> to the top of the file just in case, but no dice.</p>