ModuleNotFoundError: No module named 'IPython'

Hi! Here’s the story: after a normal reboot, I get this error every time I try to boot any kernel:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/stc/.local/lib/python3.6/site-packages/ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "/home/stc/.local/lib/python3.6/site-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/home/stc/.local/lib/python3.6/site-packages/ipykernel/connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
ModuleNotFoundError: No module named 'IPython'

Tried rebooting again, checking the PATH value (contains ~/.local/bin as expected), and updating the notebook package with pip, to no avail. Any help or insight would be appreciated. I don’t want to lose my registered kernels, and there’s risk I might lose them if I reinstall jupyter completely :slightly_frowning_face:

Turns out the environment that Jupyter Notebook was using to boot lacked the ipython package (used to be fine though). I fixed the problem by isolating the used interpreter (python3.6 vs python3.7 invoked by the python command) and installing the ipython package. Hoping this’ll be of use to someone

1 Like