My Jupyter notebook server in an Anaconda installation stops working randomly. I haven't been able to find a pattern, but I can't spend more than 15 minutes on a notebook before the server becomes unresponsive.
Out of nowhere, a random cell hangs at [*], regardless of how simple the code is, and the page becomes unresponsive. It's not possible to restart the kernel. If I try to load another tab, Chrome gets stuck "waiting for localhost" or "waiting for available socket". Closing the prompt and opening a new notebook fixes the problem for a few minutes.
The debug log doesn't seem very helpful:
[D 19:28:32.514 NotebookApp] activity on 206ba52e-60ab-47c8-a487-18ff7ed4744f: execute_input
[D 19:28:32.515 NotebookApp] activity on 206ba52e-60ab-47c8-a487-18ff7ed4744f: execute_result
[D 19:28:32.518 NotebookApp] activity on 206ba52e-60ab-47c8-a487-18ff7ed4744f: status (idle)
I've tried:
- Creating a new default ipython profile
- Updating all my packages
- Removing Anaconda completely and reinstalling it
- Using a different browser
No dice.
Not sure if this helps, but I've noticed that sometimes (but not always, and the error still happens) I'll have a ghost notebook running without its prompt:
jupyter notebook list
Currently running servers:
http://localhost:8888/?token=885427d7798f6777ad9545bf487fd3a5dfdf52c9e446bea7 :: C:\Users\User
http://localhost:8888/?token=c3ccd0c6c255077da13e6de3c8913640cb0f985bcf31e807 :: C:\Users\User
If I try to shut them down:
jupyter notebook stop
Shutting down server on port 8888 ...
Traceback (most recent call last):
File "C:\Users\User\anaconda3\Scripts\jupyter-notebook-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\User\anaconda3\lib\site-packages\jupyter_core\application.py", line 268, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\User\anaconda3\lib\site-packages\traitlets\config\application.py", line 664, in launch_instance
app.start()
File "C:\Users\User\anaconda3\lib\site-packages\notebook\notebookapp.py", line 1910, in start
super(NotebookApp, self).start()
File "C:\Users\User\anaconda3\lib\site-packages\jupyter_core\application.py", line 257, in start
self.subapp.start()
File "C:\Users\User\anaconda3\lib\site-packages\notebook\notebookapp.py", line 466, in start
if not self.shutdown_server(server):
File "C:\Users\User\anaconda3\lib\site-packages\notebook\notebookapp.py", line 457, in shutdown_server
return shutdown_server(server, log=self.log)
File "C:\Users\User\anaconda3\lib\site-packages\notebook\notebookapp.py", line 417, in shutdown_server
HTTPClient().fetch(req)
File "C:\Users\User\anaconda3\lib\site-packages\tornado\httpclient.py", line 133, in fetch
functools.partial(self._async_client.fetch, request, **kwargs)
File "C:\Users\User\anaconda3\lib\site-packages\tornado\ioloop.py", line 532, in run_sync
return future_cell[0].result()
tornado.simple_httpclient.HTTPTimeoutError: Timeout during request
I'm completely at loss! Any guidance would be appreciated.