0

python3 kernel is crashing whenever I open python3 kernel based .ipynb file

I uninstalled and reinstalled jupyter, ipython, python3.7.1 but it didn't fix the issue.

I cleared $PYTHONPATH as well. Nothing works

Any suggestions of how to fix this?

Here is the snapshot of error I am encountering when I try opening a python3 kernel .ipynb file

[I 12:13:36.200 NotebookApp] Kernel started: 47436438-d511-aaae-b9bd-7705aaa11aaa
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/Cellar/ipython/7.1.1/libexec/vendor/lib/python3.7/site-packages/ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "/usr/local/Cellar/ipython/7.1.1/libexec/vendor/lib/python3.7/site-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/usr/local/Cellar/ipython/7.1.1/libexec/vendor/lib/python3.7/site-packages/ipykernel/connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "/usr/local/Cellar/ipython/7.1.1/libexec/lib/python3.7/site-packages/IPython/__init__.py", line 54, in <module>
    from .core.application import Application
  File "/usr/local/Cellar/ipython/7.1.1/libexec/lib/python3.7/site-packages/IPython/core/application.py", line 23, in <module>
    from traitlets.config.application import Application, catch_config_error
  File "/usr/local/Cellar/ipython/7.1.1/libexec/vendor/lib/python3.7/site-packages/traitlets/config/__init__.py", line 6, in <module>
    from .application import *
  File "/usr/local/Cellar/ipython/7.1.1/libexec/vendor/lib/python3.7/site-packages/traitlets/config/application.py", line 77, in <module>
    @decorator
TypeError: 'module' object is not callable
[I 12:13:39.189 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):

The UI is saying

Dead kernel
The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened.

enter image description here

EDIT: This question is not a duplicate of accidentally made release of the ipykernel

Its different because

  • stack traces are different
  • There is no know stability issues ipython around this timeframe
  • Refer to my solution posted for this issue
Raghu
  • 25
  • 5
  • Possible duplicate of [I am using jupyter notebook, ipython 3 on windows. Whenever i am starting my python 3, i get the "Kernel Dead" message](https://stackoverflow.com/questions/35673530/i-am-using-jupyter-notebook-ipython-3-on-windows-whenever-i-am-starting-my-pyt) – Alaleh Nov 08 '18 at 10:00

1 Answers1

0

Looks like python kernel didn't like the init.py files that I created in directory sub directories from where I started jupyter notebook. Delete those init.py files fixed the kernel crash issue.

Raghu
  • 25
  • 5