title: Fixing Python on Mac
body: <p>Getting Python right on Mac seems a constant challenge.  I'm working with a Homebrew implementation, and now have difficulty running Jupyter except with sudo:</p>
  
  <pre><code>$ which python
  /usr/local/bin/python
  $ which pip
  /Users/username/bin/pip
  $ which jupyter
  /usr/local/bin/jupyter
  $ jupyter notebook
  Traceback (most recent call last):
    File "/usr/local/bin/jupyter", line 7, in &lt;module&gt;
      from jupyter_core.command import main
  ImportError: No module named jupyter_core.command
  $ sudo jupyter notebook
  The Jupyter Notebook is running at: http://localhost:8888/
  </code></pre>
  
  <p>Once running, Jupyter fails to import pandas (installed via <code>pip install pandas</code>):</p>
  
  <pre><code>import pandas
  ImportError                               Traceback (most recent call last)
  &lt;ipython-input-18-d6ac987968b6&gt; in &lt;module&gt;()
  ----&gt; 1 import pandas
  ImportError: No module named pandas
  </code></pre>
  
  <p>.. even though pandas is available (<code>python -s 'import pandas'</code> works fine).  Guessing its path isn't available to root.</p>
  
  <p>I'm wondering if Jupyter is <a href="https://github.com/jupyterhub/jupyterhub/wiki/Using-sudo-to-run-JupyterHub-without-root-privileges" rel="nofollow">particularly problematic</a> or if this is just my setup..?</p>
  
  <p>Grateful for assistance as this is becoming very tiresome.  Any guidance on wiping python and reinstalling 'properly' from scratch would be handy.</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <pre><code>$ which virtualenv
  /usr/local/bin/virtualenv
  21:16 $ virtualenv
  Traceback (most recent call last):
    File "/usr/local/bin/virtualenv", line 7, in &lt;module&gt;
      from virtualenv import main
  ImportError: No module named virtualenv
  </code></pre>