title: Anaconda: Python 3 and 2 in IPython/Jupyter Notebook
body: <p>I have a Python 3 installation of Anaconda and want to be able to switch quickly between python2 and 3 kernels. This is on OSX.</p>
  
  <p>My steps so far involved:</p>
  
  <pre><code>conda create -p ~/anaconda/envs/python2 python=2.7
  source activate python2
  conda install ipython
  ipython kernelspec install-self
  source deactivate
  </code></pre>
  
  <p>After this I have a python2 Kernel to choose from in the python3 IPython notebook, which however can't start.</p>
  
  <p>So I went ahead and modified /usr/local/share/jupyter/kernels/python2/kernel.json</p>
  
  <pre><code>{
   "display_name": "Python 2",
   "language": "python",
   "argv": [
    "/Users/sonium/anaconda/envs/python2/bin/python",
    "-m",
    "IPython.kernel",
    "-f",
    "{connection_file}"
   ],
   "env":{"PYTHONHOME":"~/anaconda/envs/python2/:~/anaconda/envs/python2/lib/"}
  }
  </code></pre>
  
  <p>Now when I start the python2 kernel it fails with:</p>
  
  <pre><code>ImportError: No module named site
  </code></pre>