Jupyter with Anaconda on Windows will not run cells
Asked Answered
G

3

13

I'm trying to run Jupyter Notebook for Anaconda 2.3.0 (64-bit) on Windows 7 (64-bit), under Python 2.7.11. Jupyter is not displaying syntax highlighting and the notebook isn't connected to the kernel, but it's not clear why. I'm running on Chrome.

Small Edit: NotebookApp (from Windows CMD or from Anaconda command line) gives a "zmq message arrived on closed channel" message. I'm not clear if that's relevant.

Bigger Edit: Based on comments below, I set c.NotebookApp.port = 8889.

Gyral answered 18/2, 2016 at 16:9 Comment(0)
U
20

Looks like the standard port 8888 is not available/blocked. Try:

jupyter notebook --port=8889

You my try a different number for the port such as 8890, 8891etc.

Umbra answered 22/2, 2016 at 20:52 Comment(0)
B
13

As already mentioned, changing from the default port fixes this issue, however I also wanted to share a solution to a specific underlying cause of this problem in case it proves helpful to others.

For myself, I was using Jupyter Notebook on Windows 10 installed through Anaconda, with Kaspersky Endpoint Security 10 on the machine. I found that it was Kaspersky that was blocking traffic over the websocket connection, which is required for the Jupyter web app to talk to the underlying Python kernel.

This was very confusing as the port was not explicitly listed as 'blocked' in any way I could see in either Windows 10 or Kaspersky, and the Jupyter process did not detect it as being in use by anything at startup.

After investigating with my works IT department, we found this is due to Kaspersky's heuristic threat detection intercepting the traffic over the websocket.

The issue was resolved by adding http://localhost/* to the trusted URL's on the Kaspersky policy (under the Web-Antivirus settings).

Beamends answered 21/9, 2016 at 15:16 Comment(2)
Very cool. Not exactly my issue, but I can see this happening to others, so it's worth an upvote. Thank you!Gyral
It was my case! Kaspersky is una mierda tonta!Sibel
P
0

It occurs when port is not working due to usage of port in another task. You can kill task in port 8888. Solution Try Steps:

  • Open cmd and find (ProcessID) for port 8888:
    netstat -aon | findstr 8888

you get result in console in this format

  TCP    127.0.0.1:8888         0.0.0.0:0              LISTENING       9660
  • kill that processID
    taskkill /f /pid 9660
  • Restart jupyter notebook as usual jupyter notebook

Another Way

  • Try using another port while starting jupyter notebook(port can be 8889, 8890, etc)
    jupyter notebook --port=8889
Pepperandsalt answered 11/12, 2022 at 12:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.