jupyter重啓失敗KernelRestarter: restart failed

在jupyter啓動時候發現出現瞭如下錯誤:

[W 11:33:41.703 NotebookApp] KernelRestarter: restart failed
[W 11:33:41.703 NotebookApp] Kernel cbc82194-2371-4227-87cf-859364cc09d4 died, removing from map.
[W 11:34:26.889 NotebookApp] Timeout waiting for kernel_info reply from cbc82194-2371-4227-87cf-859364cc09d4
[E 11:34:26.892 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: cbc82194-2371-4227-87cf-859364cc09d4)
[W 11:34:28.140 NotebookApp] 404 GET /api/kernels/cbc82194-2371-4227-87cf-859364cc09d4/channels?session_id=9614948d3c004c2b8060d1f5e165db71 (36.102.210.157): Kernel does not exist: cbc82194-2371-4227-87cf-859364cc09d4

瀏覽器中打開後發現:未能連接成功
在這裏插入圖片描述

解決方案:

pip install --upgrade ipykerne

發現繼續報錯:

(jiqistudy) root@iZ2zeemzp51mlbzarwptwwZ:~/algorithm# pip install --upgrade ipykernel
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already up-to-date: ipykernel in /root/.virtualenvs/jiqistudy/lib/python3.5/site-packages (5.2.1)
Requirement already satisfied, skipping upgrade: jupyter-client in /root/.virtualenvs/jiqistudy/lib/python3.5/site-packages (from ipykernel) (6.1.3)
Requirement already satisfied, skipping upgrade: ipython>=5.0.0 in /root/.virtualenvs/jiqistudy/lib/python3.5/site-packages (from ipykernel) (7.14.0)
ERROR: Package 'ipython' requires a different Python: 3.5.2 not in '>=3.6'

ERROR: Package 'ipython' requires a different Python: 3.5.2 not in '>=3.6'
在這裏插入圖片描述
查看包的版本:

pip list

卸載ipython包,重新安裝ipython

pip ubinstall ipython #卸載之前的ipython包
pip install ipython #重新安裝ipython包,ubuntu會自動識別應該安裝的包的版本

退出虛擬環境,重新進入文件目錄,重啓jupter

deactivate
(jiqistudy) root@iZ2zeemzp51mlbzarwptwwZ:~/algorithm# jupyter notebook --allow-root

重啓服務,連接成功!
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章