jupyter重启失败KernelRestarter: restart failed

在使用jupyter时遇到启动错误,显示未能连接成功和KernelRestarter失败。通过检查包版本,卸载并重新安装ipython,退出并重新进入虚拟环境,以及重启jupyter服务,最终成功解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在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

重启服务,连接成功!
在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值