死内核:每当我打开基于python3内核的.ipynb文件时,python3内核就会崩溃

时间:2018-11-06 20:31:00

标签: python-3.x jupyter-notebook ipython

每当我打开基于python3内核的.ipynb文件时,python3内核就会崩溃

我卸载并重新安装了jupyter,ipython,python3.7.1,但无法解决问题。

我也清除了$ PYTHONPATH。没用

关于如何解决此问题的任何建议?

这是我尝试打开python3内核.ipynb文件时遇到的错误的快照

[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):

用户界面说

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

编辑: 此问题不是accidentally made release of the ipykernel

的重复项

因为

而有所不同
  • 堆栈跟踪不同
  • 在此时间段内,ipython没有稳定性问题
  • 请参阅针对此问题发布的解决方案

1 个答案:

答案 0 :(得分:0)

像python内核一样,我不喜欢从jupyter notebook开始的目录子目录中创建的 init .py文件。删除那些 init .py文件可解决内核崩溃问题。