title: Why is conda init updating my .bash_profile incorrectly?
body: <p>After following <a href="https://stackoverflow.com/a/60902863/1601580">these steps</a> and installing conda it seems that <code>conda init</code> updates my <code>.bash_profile</code> incorrectly for some reason. It adds it's content AFTER running <code>.bashrc</code> and thus when <code>bash</code> gets started all my conda stuff does not get initiated correctly for some reason. I ended up having to change the <code>.bash_profile</code> manually to look like this:</p>
  
  <pre><code>(automl) brandBrandoParetoopareto~ $ cat .bash_profile
  # &gt;&gt;&gt; conda initialize &gt;&gt;&gt;
  # !! Contents within this block are managed by 'conda init' !!
  __conda_setup="$('/Users/brandBrandoParetoopareto/anaconda3/bin/conda' 'shell.bash' 'hook' 2&gt; /dev/null)"
  if [ $? -eq 0 ]; then
      eval "$__conda_setup"
  else
      if [ -f "/Users/brandBrandoParetoopareto/anaconda3/etc/profile.d/conda.sh" ]; then
          . "/Users/brandBrandoParetoopareto/anaconda3/etc/profile.d/conda.sh"
      else
          export PATH="/Users/brandBrandoParetoopareto/anaconda3/bin:$PATH"
      fi
  fi
  unset __conda_setup
  # &lt;&lt;&lt; conda initialize &lt;&lt;&lt;
  
  if [ -f ~/.bashrc ]; then
     source ~/.bashrc
  fi
  
  </code></pre>
  
  <p>The way I installed it was using what I thought was <a href="https://www.anaconda.com/distribution/" rel="nofollow noreferrer">the official installation</a>:</p>
  
  <pre><code>sh Anaconda3-2020.02-MacOSX-x86_64.sh
  </code></pre>
  
  <p>but that seems to be causing issues (e.g. <code>conda init bash</code> not adding the stuff in the right place to <code>.bash_profile</code>. The graphical/dmg installer even installs things at <code>~/opt</code> for some reason). I outlined the hacky solution that worked for me <a href="https://stackoverflow.com/a/60902863/1601580">here</a> but I assume that is not the right way to be doing things. </p>
  
  <p>What is causing my problems and how do I fix it?</p>