python-3.x - Jupyter 内核在 Ubuntu 上死机

标签 python-3.x ubuntu jupyter-notebook jupyter

昨晚在Ubuntu下下载了Anaconda并按照其说明安装了Jupyter。我希望复制一些用 Python 编写的相当简单的代码,这些代码已经在普通的 Python 3.x 环境中运行,并且还在 Jupyter 的试用版中运行,所以我想我们正在寻找一个系统问题。

在安装时,我首先打开一个 Python 3 笔记本,它显示“Kernel Starting please wait..”然后它说它已准备就绪,然后在几秒钟后它说内核已死并且无法重新启动。事实上,它返回特定消息“Dead kernel”。这是在我什至输入任何类型的任何代码之前。

我已经正确安装了所有东西 - 我想!

我正在运行 16.04 LTS。 Python 是 3.7

我检查了其他类似的帖子,但提供的解决方案不适合这种情况。是不是更深层次的东西。

感谢您提供的任何帮助。

Jupyter notebook --debug 的输出如下:


peter@xxxx:~$ jupyter notebook --debug
[D 19:45:46.147 NotebookApp] Searching ['/home/peter', '/home/peter/.jupyter', '/home/peter/anaconda3/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 19:45:46.149 NotebookApp] Looking for jupyter_config in /etc/jupyter
[D 19:45:46.149 NotebookApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 19:45:46.150 NotebookApp] Looking for jupyter_config in /home/peter/anaconda3/etc/jupyter
[D 19:45:46.150 NotebookApp] Looking for jupyter_config in /home/peter/.jupyter
[D 19:45:46.150 NotebookApp] Looking for jupyter_config in /home/peter
[D 19:45:46.152 NotebookApp] Looking for jupyter_notebook_config in /etc/jupyter
[D 19:45:46.152 NotebookApp] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 19:45:46.152 NotebookApp] Looking for jupyter_notebook_config in /home/peter/anaconda3/etc/jupyter
[D 19:45:46.153 NotebookApp] Looking for jupyter_notebook_config in /home/peter/.jupyter
[D 19:45:46.153 NotebookApp] Looking for jupyter_notebook_config in /home/peter
[I 19:45:46.644 NotebookApp] Serving notebooks from local directory: /home/peter
[I 19:45:46.644 NotebookApp] 0 active kernels 
[I 19:45:46.644 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
[I 19:45:46.644 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:45:46.651 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
[I 19:45:46.882 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1
[D 19:45:46.885 NotebookApp] Using contents: services/contents
[D 19:45:46.982 NotebookApp] Path base/images/favicon.ico served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/base/images/favicon.ico
[D 19:45:46.982 NotebookApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css
[D 19:45:46.983 NotebookApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/jquery-typeahead/dist/jquery.typeahead.min.css
[D 19:45:46.983 NotebookApp] Path style/style.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/style/style.min.css
[D 19:45:46.985 NotebookApp] Path components/es6-promise/promise.min.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/es6-promise/promise.min.js
[D 19:45:46.985 NotebookApp] Path components/requirejs/require.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/requirejs/require.js
[D 19:45:46.986 NotebookApp] Path base/images/logo.png served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/base/images/logo.png
[D 19:45:46.987 NotebookApp] Path tree/js/main.min.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/tree/js/main.min.js
[D 19:45:46.993 NotebookApp] 200 GET /tree?token=b921788f87fa7cc313f98e9e4e37a23f005ad3f2e727cc3f (127.0.0.1) 112.57ms
[D 19:45:47.120 NotebookApp] Path custom.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/custom/custom.css
[D 19:45:47.122 NotebookApp] 304 GET /custom/custom.css (127.0.0.1) 3.34ms
[D 19:45:47.499 NotebookApp] Path services/contents.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/services/contents.js
[D 19:45:47.501 NotebookApp] 200 GET /static/services/contents.js?v=20170427194546 (127.0.0.1) 5.54ms
[D 19:45:47.510 NotebookApp] Path custom.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/custom/custom.js
[D 19:45:47.512 NotebookApp] 200 GET /custom/custom.js?v=20170427194546 (127.0.0.1) 3.43ms
[D 19:45:47.585 NotebookApp] 200 GET /api/config/tree?_=1493318747367 (127.0.0.1) 7.78ms
[D 19:45:47.591 NotebookApp] 200 GET /api/config/common?_=1493318747368 (127.0.0.1) 4.54ms
[D 19:45:47.599 NotebookApp] 200 GET /api/terminals?_=1493318747369 (127.0.0.1) 1.57ms
[D 19:45:47.606 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:47.607 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:47.614 NotebookApp] 304 GET /api/kernelspecs (127.0.0.1) 10.39ms
[D 19:45:47.618 NotebookApp] 200 GET /api/terminals?_=1493318747371 (127.0.0.1) 1.68ms
[D 19:45:47.621 NotebookApp] 200 GET /api/sessions?_=1493318747370 (127.0.0.1) 2.22ms
[D 19:45:47.714 NotebookApp] 200 GET /api/contents?type=directory&_=1493318747372 (127.0.0.1) 40.84ms
[I 19:45:53.598 NotebookApp] Creating new notebook in 
[D 19:45:53.604 NotebookApp] Saving /home/peter/Untitled5.ipynb
[D 19:45:53.939 NotebookApp] 201 POST /api/contents (127.0.0.1) 343.75ms
[D 19:45:53.948 NotebookApp] Using contents: services/contents
[D 19:45:54.008 NotebookApp] Path components/bootstrap-tour/build/css/bootstrap-tour.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/bootstrap-tour/build/css/bootstrap-tour.min.css
[D 19:45:54.008 NotebookApp] Path components/codemirror/lib/codemirror.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/codemirror/lib/codemirror.css
[D 19:45:54.009 NotebookApp] Path notebook/css/override.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/notebook/css/override.css
[D 19:45:54.010 NotebookApp] Path components/text-encoding/lib/encoding.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/text-encoding/lib/encoding.js
[D 19:45:54.010 NotebookApp] Path notebook/js/main.min.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/notebook/js/main.min.js
[D 19:45:54.016 NotebookApp] 200 GET /notebooks/Untitled5.ipynb?kernel_name=python3 (127.0.0.1) 69.16ms
[D 19:45:54.063 NotebookApp] Path components/MathJax/MathJax.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/MathJax.js
[D 19:45:54.064 NotebookApp] 304 GET /static/components/MathJax/MathJax.js?config=TeX-AMS_HTML-full,Safe&delayStartupUntil=configured (127.0.0.1) 2.21ms
[D 19:45:54.067 NotebookApp] 304 GET /custom/custom.css (127.0.0.1) 1.47ms
[D 19:45:54.220 NotebookApp] Path components/MathJax/config/TeX-AMS_HTML-full.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/config/TeX-AMS_HTML-full.js
[D 19:45:54.221 NotebookApp] 304 GET /static/components/MathJax/config/TeX-AMS_HTML-full.js?rev=2.6.0 (127.0.0.1) 2.67ms
[D 19:45:54.635 NotebookApp] 304 GET /custom/custom.js?v=20170427194546 (127.0.0.1) 1.61ms
[D 19:45:54.711 NotebookApp] Path components/MathJax/config/Safe.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/config/Safe.js
[D 19:45:54.713 NotebookApp] 304 GET /static/components/MathJax/config/Safe.js?rev=2.6.0 (127.0.0.1) 2.84ms
[D 19:45:54.788 NotebookApp] 200 GET /api/config/notebook?_=1493318754418 (127.0.0.1) 8.55ms
[D 19:45:54.795 NotebookApp] 200 GET /api/config/common?_=1493318754419 (127.0.0.1) 5.98ms
[D 19:45:54.918 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:54.918 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:54.920 NotebookApp] 304 GET /api/kernelspecs (127.0.0.1) 3.39ms
[D 19:45:55.147 NotebookApp] 200 GET /api/contents/Untitled5.ipynb?type=notebook&_=1493318754420 (127.0.0.1) 180.31ms
[D 19:45:55.150 NotebookApp] Path components/MathJax/extensions/Safe.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/Safe.js
[D 19:45:55.151 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?rev=2.6.0 (127.0.0.1) 1.94ms
[D 19:45:55.153 NotebookApp] Path jupyter-js-widgets/extension.js served from /home/peter/anaconda3/share/jupyter/nbextensions/jupyter-js-widgets/extension.js
[D 19:45:55.158 NotebookApp] 200 GET /nbextensions/jupyter-js-widgets/extension.js?v=20170427194546 (127.0.0.1) 5.83ms
[D 19:45:55.160 NotebookApp] Path components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js
[D 19:45:55.161 NotebookApp] 304 GET /static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js?rev=2.6.0 (127.0.0.1) 2.33ms
[D 19:45:55.372 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:55.374 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:45:55.387 NotebookApp] Connecting to: tcp://127.0.0.1:39311
[I 19:45:55.389 NotebookApp] Kernel started: de446353-af9d-4b59-bfc1-a8cdb4572ac4
[D 19:45:55.390 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/home/peter'}
[D 19:45:55.393 NotebookApp] 201 POST /api/sessions (127.0.0.1) 44.08ms
[D 19:45:55.398 NotebookApp] 200 GET /api/contents/Untitled5.ipynb/checkpoints?_=1493318754421 (127.0.0.1) 3.89ms
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[D 19:45:55.554 NotebookApp] Initializing websocket connection /api/kernels/de446353-af9d-4b59-bfc1-a8cdb4572ac4/channels
[D 19:45:55.564 NotebookApp] Requesting kernel info from de446353-af9d-4b59-bfc1-a8cdb4572ac4
[D 19:45:55.565 NotebookApp] Connecting to: tcp://127.0.0.1:49900
[I 19:45:58.388 NotebookApp] KernelRestarter: restarting kernel (1/5)
[D 19:45:58.390 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:45:58.397 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:01.397 NotebookApp] KernelRestarter: restarting kernel (2/5)
[D 19:46:01.399 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:46:01.407 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:04.409 NotebookApp] KernelRestarter: restarting kernel (3/5)
[D 19:46:04.411 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:46:04.421 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:05.568 NotebookApp] Timeout waiting for kernel_info reply from de446353-af9d-4b59-bfc1-a8cdb4572ac4
[D 19:46:05.571 NotebookApp] Opening websocket /api/kernels/de446353-af9d-4b59-bfc1-a8cdb4572ac4/channels
[D 19:46:05.571 NotebookApp] Connecting to: tcp://127.0.0.1:49900
[D 19:46:05.572 NotebookApp] Connecting to: tcp://127.0.0.1:52325
[D 19:46:05.573 NotebookApp] Connecting to: tcp://127.0.0.1:38447
[I 19:46:07.423 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel de446353-af9d-4b59-bfc1-a8cdb4572ac4 restarted
[D 19:46:07.426 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:46:07.435 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:10.438 NotebookApp] KernelRestarter: restart failed
[W 19:46:10.438 NotebookApp] Kernel de446353-af9d-4b59-bfc1-a8cdb4572ac4 died, removing from map.
ERROR:root:kernel de446353-af9d-4b59-bfc1-a8cdb4572ac4 restarted failed!
[D 19:46:10.476 NotebookApp] Websocket closed de446353-af9d-4b59-bfc1-a8cdb4572ac4:3D6BAC1FF1694B3B8331E3A303569344
[W 19:46:10.482 NotebookApp] Kernel deleted before session
[W 19:46:10.483 NotebookApp] 410 DELETE /api/sessions/9710cac7-54ef-461d-a3b4-acbfcf981ce8 (127.0.0.1) 3.52ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3
[W 19:46:16.663 NotebookApp] Session not found: session_id='9710cac7-54ef-461d-a3b4-acbfcf981ce8'
[W 19:46:16.664 NotebookApp] 404 DELETE /api/sessions/9710cac7-54ef-461d-a3b4-acbfcf981ce8 (127.0.0.1) 2.51ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3
[D 19:46:16.712 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:46:16.714 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:16.723 NotebookApp] Connecting to: tcp://127.0.0.1:55773
[I 19:46:16.725 NotebookApp] Kernel started: fb22aad0-0e7c-42c5-b026-1e25ecf89439
[D 19:46:16.725 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/home/peter'}
[D 19:46:16.727 NotebookApp] 201 POST /api/sessions (127.0.0.1) 23.69ms
[D 19:46:16.766 NotebookApp] Initializing websocket connection /api/kernels/fb22aad0-0e7c-42c5-b026-1e25ecf89439/channels
[D 19:46:16.771 NotebookApp] Requesting kernel info from fb22aad0-0e7c-42c5-b026-1e25ecf89439
[D 19:46:16.771 NotebookApp] Connecting to: tcp://127.0.0.1:36903
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:19.726 NotebookApp] KernelRestarter: restarting kernel (1/5)
[D 19:46:19.728 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:19.739 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:22.742 NotebookApp] KernelRestarter: restarting kernel (2/5)
[D 19:46:22.744 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:22.753 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:25.756 NotebookApp] KernelRestarter: restarting kernel (3/5)
[D 19:46:25.758 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:25.767 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:26.773 NotebookApp] Timeout waiting for kernel_info reply from fb22aad0-0e7c-42c5-b026-1e25ecf89439
[D 19:46:26.775 NotebookApp] Opening websocket /api/kernels/fb22aad0-0e7c-42c5-b026-1e25ecf89439/channels
[D 19:46:26.776 NotebookApp] Connecting to: tcp://127.0.0.1:36903
[D 19:46:26.777 NotebookApp] Connecting to: tcp://127.0.0.1:53792
[D 19:46:26.778 NotebookApp] Connecting to: tcp://127.0.0.1:44277
[I 19:46:28.769 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel fb22aad0-0e7c-42c5-b026-1e25ecf89439 restarted
[D 19:46:28.772 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:28.781 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:31.784 NotebookApp] KernelRestarter: restart failed
[W 19:46:31.785 NotebookApp] Kernel fb22aad0-0e7c-42c5-b026-1e25ecf89439 died, removing from map.
ERROR:root:kernel fb22aad0-0e7c-42c5-b026-1e25ecf89439 restarted failed!
[D 19:46:31.843 NotebookApp] Websocket closed fb22aad0-0e7c-42c5-b026-1e25ecf89439:3D6BAC1FF1694B3B8331E3A303569344
[W 19:46:31.849 NotebookApp] Kernel deleted before session
[W 19:46:31.851 NotebookApp] 410 DELETE /api/sessions/f6a1b60a-6b90-4fd3-8166-b3de0d35cf74 (127.0.0.1) 4.29ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3
^C[I 19:46:51.302 NotebookApp] interrupted
Serving notebooks from local directory: /home/peter
0 active kernels 
The Jupyter Notebook is running at: http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
Shutdown this notebook server (y/[n])? yNo answer for 5s: resuming operation...
y
^C[I 19:47:12.400 NotebookApp] interrupted
Serving notebooks from local directory: /home/peter
0 active kernels 
The Jupyter Notebook is running at: http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
Shutdown this notebook server (y/[n])? y
[C 19:47:14.911 NotebookApp] Shutdown confirmed
[I 19:47:14.912 NotebookApp] Shutting down kernels
peter@xxxx:~$ 

最佳答案

刚刚在 Ubuntu 14.04 上遇到了同样的问题

通过升级ipykernel解决了

sudo pip install --upgrade ipykernel

关于python-3.x - Jupyter 内核在 Ubuntu 上死机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43665916/

相关文章:

python - 尝试根据列是否包含特定字符串对其进行重新编码

python - 正则表达式无法逃脱问号?

node.js - npm install 不在/usr/bin 安装东西

c++ - 如何使用USB-USB桥接电缆将两台PC与ubuntu OS连接,另一台与Windows 7 Os连接

python - 弃用警告 : Call to deprecated function get_sheet_by_name (Use wb[sheetname])

python - Pandas 在选定的列中查找重复的串联值

linux - 在 bash 脚本中正确使用退格函数

python - 如何在Python中打印缺失值的列名和缺失值的数量?

python - Jupyter 笔记本 : (OperationalError ('disk I/O error' , ))

python - ipython notebook 'run all cells'是同时执行还是顺序执行?