ImportError: No module named IPython.paths when running jupyter notebook?

Viewed 7873

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?

2 Answers

Upgrade ipython:

pip install ipython==5.3.0

If you cannot uninstall ipython, try this:

sudo -H pip install --ignore-installed -U ipython==5.3.0
Related