I installed jupyter via: /usr/local/opt/python/bin/python2.7 -m pip install jupyter
this install ipython version 4.1.2. However, when I run jupyter notebook, I get:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/Library/Python/2.7/site-packages/notebook/notebookapp.py", line 83, in <module>
from IPython.paths import get_ipython_dir
ImportError: No module named IPython.paths
yet, when I run from IPython.paths import get_ipython_dir in the ipython shell directly it works fine. Also when I run /usr/local/opt/python/bin/python2.7 and then the same thing, it runs successfully. Additionally, when I check the sys.executable path in python I get /usr/local/opt/python/bin/python2.7
This doesn't make sense to me. How can Ipython and my normal python (both using /usr/local/opt/python/bin/python2.7) both run this successfully, but my jupyter, installed with that specific python, cannot run the command. Any suggestions?
jupyter*scripts have the OS X system python in their hash-bang, not your locally installed one. You can either edit the first line in those scripts (check and edit the first line of/usr/local/bin/jupyter-notebook), or start the scripts explicitly with the correct Python executable. For example:/usr/local/op/python/bin/python2.7 /usr/local/bin/jupyter-notebook.sys.path, they may cause problems./usr/local/opt/...; I think that's a Homebrew thing? Could you check that the relevant site-packages directory (either in/usr/local/lib/python2.7or in/usr/local/opt/python/lib/pyhton2.7contains thenotebookdirectory?sys.path? And outside it, what isPYTHONPATH?