2019.3.22更新: jupyter notebook 5.7.5版本 已解决该bug,jupyter notebook升级到5.7.5即可
conda install jupyter notebook=5.7.5
问题描述
windows Jupyter notebook 连接无反应 始终connecting to kernel,
点击单元格执行无反应,连hello world都输出不了
服务端输出c:\anacondapc\envs\tf1.12\lib\site-packages\notebook\base\zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited。
[W 14:10:42.472 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 14:10:42.482 NotebookApp] Serving notebooks from local directory: C:\
[I 14:10:42.482 NotebookApp] The Jupyter Notebook is running at:
[I 14:10:42.482 NotebookApp] http://(yeppc or 127.0.0.1):8888/
[I 14:10:42.483 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 14:10:57.726 NotebookApp] 302 GET / (192.168.199.166) 0.00ms
[I 14:11:36.081 NotebookApp] Kernel started: a229546a-8f2f-46d0-ac1c-0fac83b4b238
[I 14:11:36.729 NotebookApp] Adapting to protocol v5.1 for kernel a229546a-8f2f-46d0-ac1c-0fac83b4b238
c:\anacondapc\envs\tf1.12\lib\site-packages\notebook\base\zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
[W 14:11:37.747 NotebookApp] Replacing stale connection: a229546a-8f2f-46d0-ac1c-0fac83b4b238:2f2f91288adb4a658bc8b1b111d87f31
问题原因
tornado版本冲突,jupyter 5.7.5版本一下并不支持tornado6.0。
jupyter notebook 5.7.5版本已经修复改bug
可conda list 查看包tornado版本。
可将tornado降级为6.0以下版本,或者升级jupyter notebook到5.7.5版本以上
解决
- 升级jupyter notebook到5.7.5以上
通过pip 升级
pip install jupyter notebook==5.7.5
通过conda降级
conda install jupyter notebook==5.7.5
- 或者ornado降级为6.0以下版本
通过pip 降级
pip install tornado==4.5.3
通过conda降级
pip install tornado==4.5.3