title: JupyterLab in Homebrew-installed Anaconda fails to start kernel, looks for old install
body: <p>I was hoping someone could help me understand why JupyterLab fails to spin up a kernel on my system.</p>
  
  <h3>Background</h3>
  
  <p>I'm working on macOS High Sierra.  I used to have Anaconda installed via the Mac OS installer in the default location in my home folder  (<code>$HOME/anaconda</code>). Based on <a href="https://stackoverflow.com/questions/42182706/how-to-uninstall-anaconda-completely-from-macos?rq=1">this thread</a> I uninstalled Anaconda.</p>
  
  <p>I reinstalled Anaconda from the Homebrew Cask (placing <code>export PATH=/usr/local/anaconda3/bin:"$PATH"</code> in my <code>.bashrc</code>).</p>
  
  <h3>The Problem</h3>
  
  <p>Now when I</p>
  
  <ul>
  <li>run <code>jupyter-lab</code>,</li>
  <li>create a new notebook, and</li>
  <li>select a Python 3 kernel,</li>
  </ul>
  
  <p>the process fails with the following output:</p>
  
  <p><code>
  Traceback (most recent call last):
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1543, in _execute
      result = yield result
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
      value = future.result()
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
      yielded = self.gen.throw(*exc_info)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post
      type=mtype))
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
      value = future.result()
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
      yielded = self.gen.throw(*exc_info)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
      kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
      value = future.result()
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
      yielded = self.gen.throw(*exc_info)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
      self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
      value = future.result()
    File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 315, in wrapper
      yielded = next(result)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 148, in start_kernel
      super(MappingKernelManager, self).start_kernel(**kwargs)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
      km.start_kernel(**kwargs)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/manager.py", line 259, in start_kernel
      **kw)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
      return launch_kernel(kernel_cmd, **kw)
    File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/launcher.py", line 128, in launch_kernel
      proc = Popen(cmd, **kwargs)
    File "/usr/local/anaconda3/lib/python3.6/subprocess.py", line 709, in __init__
      restore_signals, start_new_session)
    File "/usr/local/anaconda3/lib/python3.6/subprocess.py", line 1344, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: '~/anaconda/bin/python': '~/anaconda/bin/python'
  </code></p>
  
  <p>I'd already removed all references to <code>$HOME/anaconda</code> (my old install location) from my environment (<code>.bashrc</code>, <code>.bash_profile</code>), so I can't figure out where the reference is being picked up.</p>
  
  <p>Any suggestions would be greatly appreciated.</p>