How do I specify which python and which modules are being used in my jupyter notebook?
Question: When I do

    
    
    import sys
    sys.executable
    

I get `'/usr/local/opt/python/bin/python2.7'` in my ordinary python shell and
`'/usr/bin/python'` in IPython or my jupyter notebook. I would like to force
my jupyter notebook to use this same python that the shell is using. I have
installed many modules and would like to be able to use the same ones in
jupyter than I am using already in the shell. How can I do this?


Answer: The simplest way is to install IPython and Jupyter with the Python you want
them to use. You can do this using pip:

    
    
    path/to/python -m pip install jupyter
    

You could alternatively set up the IPython kernel to run with your desired
Python without reinstalling the notebook. See [the docs on installing
kernels](http://ipython.readthedocs.org/en/stable/install/kernel_install.html).
This is more complicated than just installing everything again, though.

