Jupyter notebook not connecting to kernel

Hi, I see this a common problem, but I don’t know how to solve this specifcally. I’m working through Python for Data Analysis by Wes McKinney and thought I’d set up a Jupyter Notebook. I’ve used it briefly in the past without problem. However, when I tried this time, I’m simply unable to connect to a kernel.

Can anyone please help me understand what’s going wrong please?

What error messages do you see (within your notebook and, more importantly, in the Notebook server’s command window)?

(pydata-book) C:\Users\hammo>jupyter notebook
[W 2023-12-12 13:50:49.609 ServerApp] A _jupyter_server_extension_points function was not found in jupyter_lsp. Instead, a _jupyter_server_extension_paths function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[W 2023-12-12 13:50:49.656 ServerApp] A _jupyter_server_extension_points function was not found in notebook_shim. Instead, a _jupyter_server_extension_paths function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-12-12 13:50:49.656 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-12-12 13:50:49.672 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2023-12-12 13:50:49.672 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-12-12 13:50:49.687 ServerApp] notebook | extension was successfully linked.
[I 2023-12-12 13:50:50.000 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-12-12 13:50:50.031 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-12-12 13:50:50.031 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-12-12 13:50:50.031 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2023-12-12 13:50:50.031 LabApp] JupyterLab extension loaded from C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\jupyterlab
[I 2023-12-12 13:50:50.031 LabApp] JupyterLab application directory is C:\Users\hammo\miniconda3\envs\pydata-book\share\jupyter\lab
[I 2023-12-12 13:50:50.031 LabApp] Extension Manager is ‘pypi’.
[I 2023-12-12 13:50:50.031 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-12-12 13:50:50.046 ServerApp] notebook | extension was successfully loaded.
[I 2023-12-12 13:50:50.046 ServerApp] Serving notebooks from local directory: C:\Users\hammo
[I 2023-12-12 13:50:50.046 ServerApp] Jupyter Server 2.12.1 is running at:
[I 2023-12-12 13:50:50.046 ServerApp] http://localhost:8888/tree?token=286b7e8cd029cbadfcf5d46d4af8bf5775b6f2a24eda6b05
[I 2023-12-12 13:50:50.046 ServerApp] http://127.0.0.1:8888/tree?token=286b7e8cd029cbadfcf5d46d4af8bf5775b6f2a24eda6b05
[I 2023-12-12 13:50:50.046 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-12-12 13:50:50.093 ServerApp]

To access the server, open this file in a browser:
    file:///C:/Users/hammo/AppData/Roaming/jupyter/runtime/jpserver-24756-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/tree?token=286b7e8cd029cbadfcf5d46d4af8bf5775b6f2a24eda6b05
    http://127.0.0.1:8888/tree?token=286b7e8cd029cbadfcf5d46d4af8bf5775b6f2a24eda6b05

[I 2023-12-12 13:50:50.173 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[I 2023-12-12 13:50:57.639 ServerApp] Creating new notebook in
[I 2023-12-12 13:51:01.227 ServerApp] Kernel started: 65de20e2-b5e4-40eb-8f4d-566fe41e1968
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\ipykernel_launcher.py”, line 17, in
app.launch_new_instance()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\traitlets\config\application.py”, line 1077, in launch_instance
app.start()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\ipykernel\kernelapp.py”, line 737, in start
self.io_loop.start()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\tornado\platform\asyncio.py”, line 195, in start
self.asyncio_loop.run_forever()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\asyncio\base_events.py”, line 607, in run_forever
self._run_once()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\asyncio\base_events.py”, line 1884, in _run_once
event_list = self._selector.select(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\selectors.py”, line 323, in select
r, w, _ = self._select(self._readers, self._writers, , timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\selectors.py”, line 314, 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
[I 2023-12-12 13:51:04.198 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\ipykernel_launcher.py”, line 17, in
app.launch_new_instance()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\traitlets\config\application.py”, line 1077, in launch_instance
app.start()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\ipykernel\kernelapp.py”, line 737, in start
self.io_loop.start()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\tornado\platform\asyncio.py”, line 195, in start
self.asyncio_loop.run_forever()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\asyncio\base_events.py”, line 607, in run_forever
self._run_once()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\asyncio\base_events.py”, line 1884, in _run_once
event_list = self._selector.select(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\selectors.py”, line 323, in select
r, w, _ = self._select(self._readers, self._writers, , timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\selectors.py”, line 314, 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
[I 2023-12-12 13:51:07.230 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[I 2023-12-12 13:51:08.281 ServerApp] Connecting to kernel 65de20e2-b5e4-40eb-8f4d-566fe41e1968.
Traceback (most recent call last):
File “C:\Users\hammo\miniconda3\envs\pydata-book\Scripts\jupyter-notebook-script.py”, line 9, in
sys.exit(main())
^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\jupyter_server\extension\application.py”, line 622, in launch_instance
serverapp.start()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\jupyter_server\serverapp.py”, line 2968, in start
self.start_ioloop()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\jupyter_server\serverapp.py”, line 2954, in start_ioloop
self.io_loop.start()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\site-packages\tornado\platform\asyncio.py”, line 195, in start
self.asyncio_loop.run_forever()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\asyncio\base_events.py”, line 607, in run_forever
self._run_once()
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\asyncio\base_events.py”, line 1884, in _run_once
event_list = self._selector.select(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\selectors.py”, line 323, in select
r, w, _ = self._select(self._readers, self._writers, , timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\hammo\miniconda3\envs\pydata-book\Lib\selectors.py”, line 314, 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
[IPKernelApp] WARNING | Parent appears to have exited, shutting down.

What platform are you on?
Windows 10

How did you install Jupyter?
Using Miniconda, and then conda install -y jupyter

What have you tried already?
Reinstalling miniconda, anaconda