'Connection to the Jupyter Notebook Server could not be established

For the past many months I am trying to code in Jupyter Notebook but whenever I open Jupyter Notebook, then, I see a message where it is written '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.'

I ran Juypter Notebook in both normal way and in Administrator in powershell but then also, it did not worked.

I even uninstalled Jupyter Notebook and reinstalled it again.

The thing which I see when I first open Jupyter Notebook:-

kernel connecting

The image showing 'kernel connection failed'

failed to connect jupyter notebook server



Solution 1:[1]

On my Win 10 install / Python 3.8.3rc1 / tornado 6.1 I was starting Jupyter-labs.exe from a command prompt, it was exiting and bringing up the error : A connection to the Jupyter server could not be established. :

Running the Command Prompt as Admin or starting Jupyter-labs-exe from powershell corrected the issue

Solution 2:[2]

Downgrading the tornado package solved this problem for me.

conda uninstall tornado

conda install tornado==5.1.1

Solution 3:[3]

With python = 3.8 this option does not work.
This option does not work with python 3.8 Specifications:

   - tornado == 5.1.1 -> python [version = '> = 2.7, <2.8.0a0 |> = 3.5, <3.6.0a0 |> = 3.6, <3.7.0a0 |> = 3.7, <3.8.0a0' .

How could I switch to python 3.7, without affecting the rest of the Anaconda3 package that installed python 3.8 for me?

Solution 4:[4]

It happens to me also and I've tried everything. The thing is that you don't have to close the powershell (or cmd) window while you are working in the jupyter notebook, because the cmd or the powershell IS the kernel.

https://www.dummies.com/programming/python/interacting-kernel-python-programming/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user17801524
Solution 2 Tasnim Tabassum
Solution 3 efueyo
Solution 4 Costa