Notebook: No module named 'IPython.paths'

Created on 12 Jun 2016  路  8Comments  路  Source: jupyter/notebook

KernelRestarter: restarting kernel (1/5) Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details __import__(pkg_name) File "/usr/local/lib/python3.5/dist-packages/ipykernel/__init__.py", line 2, in <module> from .connect import * File "/usr/local/lib/python3.5/dist-packages/ipykernel/connect.py", line 14, in <module> from IPython.paths import get_ipython_dir ImportError: No module named 'IPython.paths'

Most helpful comment

I get this error, when trying to add python3 kernel to jupyter:

python2 -m pip install ipykernel
python2 -m ipykernel install --user

python3 -m pip install ipykernel
---> python3 -m ipykernel install --user


Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/botcs/.local/lib/python3.5/site-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/home/botcs/.local/lib/python3.5/site-packages/ipykernel/connect.py", line 14, in <module>
    from IPython.paths import get_ipython_dir
ImportError: No module named 'IPython.paths'

All 8 comments

this happens when I try to start a kernel.

Did you close the issue because you fixed it? That error message usually
means import has found an old version of IPython.

yeah, i upgraded pip and jupyter and it seems to work fine now.

I get this error, when trying to add python3 kernel to jupyter:

python2 -m pip install ipykernel
python2 -m ipykernel install --user

python3 -m pip install ipykernel
---> python3 -m ipykernel install --user


Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/botcs/.local/lib/python3.5/site-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/home/botcs/.local/lib/python3.5/site-packages/ipykernel/connect.py", line 14, in <module>
    from IPython.paths import get_ipython_dir
ImportError: No module named 'IPython.paths'

It usually means it's finding an older version of IPython somewhere. Try uninstalling and reinstalling IPython. Look out for copies that might be installed by system package managers (e.g. apt), which are often outdated.

Different versions with pip were installed (both pip2 and pip3) also with apt - and after removing every installations, I was still able to launch jupyter... I installed iTorch a year ago, with some ez-install method, turns out I could not find any manager which would reveal this installation. So I removed everything with jupyter in its name - and after I checked that there is no way to start jupyter anymore, I installed with pip, and now it is working fine.

Great. :-) This is one of those things where the fix is usually 'uninstall everything related and set it up again', but there are so many different ways things can be installed, it's hard to automate removing them.

change to another IPython:

pip uninstall ipython
pip install ipython==5.3.0
Was this page helpful?
0 / 5 - 0 ratings