Issue connecting to the Kernel in Jupyter notebook

Question:

I have just installed my Jupyter notebook to run Python . I have an active internet connection and python installed . I am getting an error saying "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."

The error is shown in the figure below
enter image description here

I tried running "conda info" on my terminal. This is what I got.

enter image description here

This is the output of my Jupyter notebook terminal

enter image description here

I tried reading many solutions on internet but it did not work .Can u please help me out?.

Asked By: Karthik KK

||

Answers:

I think you may have too many variables affecting your install to be able to determine exactly what is wrong. I would recommend starting with a fresh install of Python use either 3.10.8 or 3.11.0:

https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe

https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe

Make sure you check the box for adding python.exe to PATH on the first step of the installer.

Check that the newly installed version is the correct one in your PATH:

c:>python -V

If the version shown is different than the one you just installed, go look at your environemnt variables and make sure that your PATH is correct: the new install should be earlier in the PATH than other Python installs (or remove the others from PATH completely).

Then create an empty virtual environment from that Python install:

c:>python -m venv c:pathtomyenv

https://docs.python.org/3/library/venv.html#creating-virtual-environments

Then activate the fresh virtual environment:

C:> c:pathtomyenvScriptsactivate.bat

Now install JupyterLab

pip install wheel jupyterlab

Finally, run JupyterLab:

jupyter lab

This should open the browser automagically. If you are still having problems, you have narrowed the number of variables because this is a clean basic install with nothing except for JupyterLab and nothing else. However, you may still have some configuration from a previous install. If you were working in that previous install and may have some valuable configuration settings, change the name of these directories to keep a copy of the old one to sort through on your own later: %PROGRAMDATA%jupyter and %APPDATA%jupyter. Or, if you have never gotten the previous install working at all, just delete these directories altogether. The next time you start Jupyter, they will be created fresh.

Answered By: Utkonos