Jupyter Notebook无法连接到内核 [英] Jupyter notebook failing to connect to kernel

查看:5086
本文介绍了Jupyter Notebook无法连接到内核的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Python 3内核(检查它是否在kernelspec列表中).

I'm attempting to use Python 3 kernel (checked it's in kernelspec list).

我创建一个笔记本,并在第一个单元格print("test")中.

I create a notebook, and in the first cell print("test").

当我执行单元格时,什么也没有发生.我只看到In[*].它似乎永远不会执行.

When I execute the cell, nothing happens. I just see In[*]. It never seems to execute.

最终我得到:

Connection failed
A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.

这是唯一运行的笔记本电脑.我可以看到Juptyer仍在终端中运行.

It's the only notebook running. I can see Juptyer is still running in the terminal.

我在运行最新版Chrome的Mac OSX上.通过pip3安装了Jupyter,通过Brew安装了python3.

I'm on Mac OSX running latest Chrome. Installed Jupyter via pip3 and python3 via Brew.

在Chrome控制台中,我看到的唯一错误是:

In Chrome console, only error I see is:

kernel.js:461 WebSocket connection to 'ws://localhost:8888/api/kernels/b9458856-e8f1-43b1-b91e-c50a9bb637bb/channels?session_id=7ded0972f5ce4517af94f45d6e0e16cf' failed: Error during WebSocket handshake: Unexpected response code: 200

我在终端上看到的唯一错误是:

Only error I ever see in the terminal is:

Warning: coroutine 'WebSocketHandler.get' was never awaited
  super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)

其他一切看起来都很正常.

Everything else looks normal.

有什么想法会导致websocket返回200?

Any ideas what would be causeing the websocket to return a 200?

更新: 笔记本服务器的版本为:5.7.4 服务器正在此版本的Python上运行: Python 3.7.2(默认,2019年2月12日,08:16:38) [Clang 10.0.0(clang-1000.11.45.5)]

Update: The version of the notebook server is: 5.7.4 The server is running on this version of Python: Python 3.7.2 (default, Feb 12 2019, 08:16:38) [Clang 10.0.0 (clang-1000.11.45.5)]

推荐答案

在Mac上使用python3 virtualenv出现相同的问题

Had the same issue on mac using a python3 virtualenv

在您所处环境或venv的终端中,或尝试:

In the terminal in your environment or venv or try:

sudo pip3 uninstall tornado
sudo pip3 install tornado==5.1.1

贷记给: vvk2001github,位于: https://github.com/jupyter/notebook/issues/4399

Credit to: vvk2001github at: https://github.com/jupyter/notebook/issues/4399

这篇关于Jupyter Notebook无法连接到内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆