Reputation: 4963
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?
Upvotes: 4
Views: 8470
Reputation: 1
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
Upvotes: 0
Reputation: 2642
I had the same problem. Just now this helped me. Someone might find this useful.
from IPython.paths import get_ipython_dir
ImportError: No module named IPython.paths
So I was running Python 3 on Linux mint 17. I first uninstalled jupyter from my system using the command.
sudo -H pip3 uninstall jupyter
After successfully uninstalling I installed jupyter again with the following command.
sudo -H pip3 install jupyter
And when I launched jupyter again using
jupyter notebook
The kernel
didn't die or didn't restart. Everything works fine now. I hope atleast one person finds this useful.
Upvotes: 4