Jason Nichols
Jason Nichols

Reputation: 3760

Jupyter notebook failing to connect to kernel

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

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

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

Eventually I get:

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.

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

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

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.

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

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)]

Upvotes: 2

Views: 10766

Answers (1)

kaleo
kaleo

Reputation: 56

Had the same issue on mac using a python3 virtualenv

In the terminal in your environment or venv or try:

sudo pip3 uninstall tornado
sudo pip3 install tornado==5.1.1

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

Upvotes: 4

Related Questions