Running notebook throwing errros

Hello All,

I am new to jupyter notebook and trying to run with give below errors. I also updated the configuration file and set the c.NotebookApp.ip = ‘127.0.0.1’,

==
I 2022-02-22 19:47:53.084 LabApp] JupyterLab application directory is C:\Users\AlokKumar\anaconda3\share\jupyter\lab
[I 19:47:53.105 NotebookApp] Serving notebooks from local directory: C:\Users\AlokKumar
[I 19:47:53.106 NotebookApp] Jupyter Notebook 6.4.5 is running at:
[I 19:47:53.106 NotebookApp] http://localhost:8888/?token=fe7b6c3d9e8fe69cf5905289ca1ece65a8f55b5391698c43
[I 19:47:53.106 NotebookApp] or http://127.0.0.1:8888/?token=fe7b6c3d9e8fe69cf5905289ca1ece65a8f55b5391698c43
[I 19:47:53.106 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:47:53.189 NotebookApp]

To access the notebook, open this file in a browser:
    file:///C:/Users/AlokKumar/AppData/Roaming/jupyter/runtime/nbserver-14180-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=fe7b6c3d9e8fe69cf5905289ca1ece65a8f55b5391698c43
 or http://127.0.0.1:8888/?token=fe7b6c3d9e8fe69cf5905289ca1ece65a8f55b5391698c43

[I 19:48:04.092 NotebookApp] Creating new notebook in
[I 19:48:11.762 NotebookApp] Kernel started: 978dbcff-a33c-42c0-b13b-12aebaf6a6e4, name: python3
Traceback (most recent call last):
File “C:\Users\AlokKumar\anaconda3\lib\runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Users\AlokKumar\anaconda3\lib\runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\ipykernel_launcher.py”, line 16, in
app.launch_new_instance()
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\traitlets\config\application.py”, line 846, in launch_instance
app.start()
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\ipykernel\kernelapp.py”, line 665, in start
self.kernel.start()
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\ipykernel\ipkernel.py”, line 178, in start
super(IPythonKernel, self).start()
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\ipykernel\kernelbase.py”, line 496, in start
asyncio.run_coroutine_threadsafe(self.poll_control_queue(), control_loop.asyncio_loop)
File “C:\Users\AlokKumar\anaconda3\lib\asyncio\tasks.py”, line 933, in run_coroutine_threadsafe
loop.call_soon_threadsafe(callback)
File “C:\Users\AlokKumar\anaconda3\lib\asyncio\base_events.py”, line 791, in call_soon_threadsafe
self._check_closed()
File “C:\Users\AlokKumar\anaconda3\lib\asyncio\base_events.py”, line 510, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine ‘Kernel.poll_control_queue’ was never awaited
[I 19:48:17.742 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
Exception in thread Thread-6:
Traceback (most recent call last):
File “C:\Users\AlokKumar\anaconda3\lib\threading.py”, line 973, in _bootstrap_inner
self.run()
File “C:\Users\AlokKumar\anaconda3\lib\threading.py”, line 910, in run
self._target(*self._args, **self._kwargs)
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\ipykernel\iostream.py”, line 81, in _thread_main
self.io_loop.start()
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\tornado\platform\asyncio.py”, line 199, in start
self.asyncio_loop.run_forever()
File “C:\Users\AlokKumar\anaconda3\lib\asyncio\base_events.py”, line 596, in run_forever
self._run_once()
File “C:\Users\AlokKumar\anaconda3\lib\asyncio\base_events.py”, line 1854, in _run_once
event_list = self._selector.select(timeout)
File “C:\Users\AlokKumar\anaconda3\lib\selectors.py”, line 324, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File “C:\Users\AlokKumar\anaconda3\lib\selectors.py”, line 315, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket

Regards
Alok Beheria

Did you try the 9999 port when you started it like suggested here? That alone seems unlikely to help; however, maybe worth trying before uninstalling and reinstalling.

Did you only install using conda or have you been mixing and matching. That error came up when someone had been doing that here; however, may be completely unrelated if you have been using conda exclusively.

Bad installation was also the diagnosis here when similar issues were reported.

Thanks for your inputs , Yes, I also tried to set ports , but that too didn’t work. I installed Anaconda and launched jupyter python and after the installation , it worked fine for 1 day ,after that , it stopped working and throwing me errors which I shared here.

Ragards

Now, I am seeing following errors now.

RuntimeError: Event loop is closed
[W 14:43:07.450 NotebookApp] Timeout waiting for kernel_info reply from c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:12.078 NotebookApp] Nudge: attempt 10 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:17.185 NotebookApp] Nudge: attempt 20 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:22.304 NotebookApp] Nudge: attempt 30 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:27.408 NotebookApp] Nudge: attempt 40 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:32.533 NotebookApp] Nudge: attempt 50 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:37.677 NotebookApp] Nudge: attempt 60 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:42.789 NotebookApp] Nudge: attempt 70 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:47.922 NotebookApp] Nudge: attempt 80 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:53.032 NotebookApp] Nudge: attempt 90 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:43:58.160 NotebookApp] Nudge: attempt 100 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[W 14:44:03.287 NotebookApp] Nudge: attempt 110 on kernel c3dc16d7-2230-44a3-9ec6-8797b652ae47
[I 14:44:07.263 NotebookApp] Saving file at /Untitled10.ipynb
[E 14:44:07.495 NotebookApp] Uncaught exception GET /api/kernels/c3dc16d7-2230-44a3-9ec6-8797b652ae47/channels?session_id=aeffd46225a544098dead09646d6142c (::1)
HTTPServerRequest(protocol=‘http’, host=‘localhost:8889’, method=‘GET’, uri=’/api/kernels/c3dc16d7-2230-44a3-9ec6-8797b652ae47/channels?session_id=aeffd46225a544098dead09646d6142c’, version=‘HTTP/1.1’, remote_ip=’::1’)
Traceback (most recent call last):
File “C:\Users\AlokKumar\anaconda3\lib\site-packages\tornado\websocket.py”, line 956, in _accept_connection
await open_result
tornado.util.TimeoutError: Timeout
[W 14:44:08.525 NotebookApp] Replacing stale connection: c3dc16d7-2230-44a3-9ec6-8797b652ae47:aeffd46225a544098dead09646d6142c
[I 14:46:07.315 NotebookApp] Saving file at /Untitled10.ipynb

Just to update here and if anyone having same issue , I was able to fix this by running following.

pip uninstall pyzmq
pip install pyzmq==19.0.2
restart jupyter

Regards

1 Like

When looking at your first issue, I saw someone suggest about pyzmq (maybe it was this post that came up when searching run.py error) and I almost included it. However, they actually had zmq errors in the traceback they posted. Closest you had was something about tornado, and so I deleted that suggestion. Also I was under the impression you were only using anaconda to install things and not mixing conda and pip. I guess I should just include that step in future advice.
Glad you got it resolved. Let’s hope it will keep working a day after this time, too.
Special thanks for posting what helped. Likely that will help someone in a similar situation.