Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter Notebook Kernel Not Connecting: Connection Failed #5024

Closed
toanasahmed opened this issue Nov 1, 2019 · 87 comments
Closed

Jupyter Notebook Kernel Not Connecting: Connection Failed #5024

toanasahmed opened this issue Nov 1, 2019 · 87 comments

Comments

@toanasahmed
Copy link

With Regards,

I have installed Anaconda and then launch Jupyter Notebook .Being a noob I am trying printing my name in it I am not getting the ouput.

I have downgraded the tornado to 5.1.1, but still it is not working.
I have Python 3.7.1 installed.

There is something ipykernel which I have installed by using pip install ipykernel but again nothing happens.

Moreover on typing jupyter kernelspec list I ve got this
C:\Users\This-PC>jupyter kernelspec list Available kernels: python3 c:\users\this-pc\appdata\local\programs\python\python37-32\share\jupyter\kernels\python3

I am attaching some images please find out.
If you need anything else I will supply it.

Thank you.

Errors:
Error

Not connecting

@toanasahmed toanasahmed changed the title Kernel Not Connecting Jupyter Notebook Kernel Not Connecting: Connection Failed Nov 1, 2019
@xh22
Copy link

xh22 commented Nov 1, 2019

i have the same problem!!

@kevin-bates
Copy link
Member

Could you please provide the output you see on the Notebook server's console? It may show some clues as to what might be happening.

@toanasahmed
Copy link
Author

Could you please provide the output you see on the Notebook server's console? It may show some clues as to what might be happening.

I have attached the images for the output
Here it is:
Error
Not connecting

@kevin-bates
Copy link
Member

@toanasahmed - this is the output on the Notebook itself. I'm talking about the terminal/shell in which the command jupyter notebook was invoked. It should contain some traceback information or the like relative to this issue.

I would also recommend restarting the notebook server with debug logging enabled (e.g., jupyter notebook --debug ... which will produce additional information that may prove helpful. Thanks.

@toanasahmed
Copy link
Author

Thanks for your quick reply.

Here is the output for jupyter notebook :
Command Prompt

And this is the outcome for jupyter notebook - debug . . . after restarting the notebook server:
`C:\Users\This-PC>jupyter notebook - debug . . .
The Jupyter HTML Notebook.

This launches a Tornado based HTML Notebook Server that serves up an
HTML5/Javascript Notebook client.

Subcommands

Subcommands are launched as jupyter-notebook cmd [args]. For information on
using subcommand 'cmd', do: jupyter-notebook cmd -h.

list
List currently running notebook servers.
stop
Stop currently running notebook server for a given port
password
Set a password for the notebook server.

Options

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--debug
set log level to logging.DEBUG (maximize logging output)
--generate-config
generate default config file
-y
Answer yes to any questions instead of prompting.
--no-browser
Don't open the notebook in a browser after startup.
--pylab
DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
--no-mathjax
Disable MathJax

MathJax is the javascript library Jupyter uses to render math/LaTeX. It is
very large, so you may want to disable it if you have a slow internet
connection, or for offline use of the notebook.

When disabled, equations etc. will appear as their untransformed TeX source.

--allow-root
Allow the notebook to be run from root user.
--script
DEPRECATED, IGNORED
--no-script
DEPRECATED, IGNORED
--log-level= (Application.log_level)
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--config= (JupyterApp.config_file)
Default: ''
Full path of a config file.
--ip= (NotebookApp.ip)
Default: 'localhost'
The IP address the notebook server will listen on.
--port= (NotebookApp.port)
Default: 8888
The port the notebook server will listen on.
--port-retries= (NotebookApp.port_retries)
Default: 50
The number of additional ports to try if the specified port is not
available.
--transport= (KernelManager.transport)
Default: 'tcp'
Choices: ['tcp', 'ipc']
--keyfile= (NotebookApp.keyfile)
Default: ''
The full path to a private key file for usage with SSL/TLS.
--certfile= (NotebookApp.certfile)
Default: ''
The full path to an SSL/TLS certificate file.
--client-ca= (NotebookApp.client_ca)
Default: ''
The full path to a certificate authority certificate for SSL/TLS client
authentication.
--notebook-dir= (NotebookApp.notebook_dir)
Default: ''
The directory to use for notebooks and kernels.
--browser= (NotebookApp.browser)
Default: ''
Specify what command to use to invoke a web browser when opening the
notebook. If not specified, the default browser will be determined by the
webbrowser standard library module, which allows setting of the BROWSER
environment variable to override it.
--pylab= (NotebookApp.pylab)
Default: 'disabled'
DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
--gateway-url= (GatewayClient.url)
Default: None
The url of the Kernel or Enterprise Gateway server where kernel
specifications are defined and kernel management takes place. If defined,
this Notebook server acts as a proxy for all kernel management and kernel
specification retrieval. (JUPYTER_GATEWAY_URL env var)

To see all available configurables, use --help-all

Examples

jupyter notebook                       # start the notebook
jupyter notebook --certfile=mycert.pem # use SSL/TLS certificate
jupyter notebook password              # enter a password to protect the server

[C 00:05:56.683 NotebookApp] Bad config encountered during initialization:
[C 00:05:56.683 NotebookApp] Invalid argument: '-'
`

@kevin-bates
Copy link
Member

@toanasahmed - we're actually going backwards here from a troubleshooting standpoint, so let's try to address the issues I see in your response and we'll go from there.

  1. The debug flag uses two dashes and no space between the second dash and the string 'debug'. It is literally --debug. The ellipses (e.g., ...) were purely meant to represent the rest of your command line when jupyter notebook was started the first time. They should not be included in your command and is why jupyter produced its help output because it couldn't parse those options. If you don't know how your jupyter server was started originally, then it may not be possible to continue this exercise unless your original command was simply jupyter notebook.
  2. From the screen shot of your server console, I see you probably have two previous instances of jupyter server running. The first is using port 8888, the second is using port 8889 and the final (current) instance is listening on port 8890. I would strongly recommend you terminate all instances so that only one is running (with the --debug flag). To terminate instances, go to their command window/terminal and enter <control-C> twice. This will terminate a single instance of a server. If you no longer have access to those terminals, you'll need to determine the notebook process and terminate it.
  3. Once you start a jupyter server with debug enabled, you'll need to attempt to use a kernel. Its that attempted use of the kernel that should produce more information on the terminal window in which you started the server. Its that information that is desired. From your output above, I just see an instance (likely the third instance) of notebook server started successfully, but because you didn't attempt to start a kernel, I can't help with the original issue.

Once the these three points are addressed I think we should be able to move forward on troubleshooting your original issue. Thanks.

@xh22
Copy link

xh22 commented Nov 4, 2019

image

@xh22
Copy link

xh22 commented Nov 4, 2019

can u take a look for me? thanks.

@kevin-bates
Copy link
Member

😄 I believe "interesting portions" of the terminal output have scrolled off your screen. Please capture the entire startup sequence, either via screen-scrape or by redirecting the output to a file.

What we can see is that it appears the kernel-info response has not been received. This is consistent with the kernel not completely starting. I'm hoping some "useful" information is above the various GET responses. There should be information pertaining to the kernel's startup.

@xh22
Copy link

xh22 commented Nov 5, 2019

(my-rdkit-env) [root@localhost ~]# jupyter notebook --allow-root --debug
[D 17:14:33.065 NotebookApp] Searching ['/root', '/root/.jupyter', '/root/anaconda3/envs/my-rdkit-env/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 17:14:33.066 NotebookApp] Looking for jupyter_config in /etc/jupyter
[D 17:14:33.066 NotebookApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 17:14:33.066 NotebookApp] Looking for jupyter_config in /root/anaconda3/envs/my-rdkit-env/etc/jupyter
[D 17:14:33.066 NotebookApp] Looking for jupyter_config in /root/.jupyter
[D 17:14:33.066 NotebookApp] Looking for jupyter_config in /root
[D 17:14:33.067 NotebookApp] Looking for jupyter_notebook_config in /etc/jupyter
[D 17:14:33.067 NotebookApp] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 17:14:33.067 NotebookApp] Looking for jupyter_notebook_config in /root/anaconda3/envs/my-rdkit-env/etc/jupyter
[D 17:14:33.068 NotebookApp] Loaded config file: /root/anaconda3/envs/my-rdkit-env/etc/jupyter/jupyter_notebook_config.json
[D 17:14:33.068 NotebookApp] Looking for jupyter_notebook_config in /root/.jupyter
[D 17:14:33.068 NotebookApp] Loaded config file: /root/.jupyter/jupyter_notebook_config.py
[D 17:14:33.069 NotebookApp] Loaded config file: /root/.jupyter/jupyter_notebook_config.json
[W 17:14:33.069 NotebookApp] Collisions detected in /root/.jupyter/jupyter_notebook_config.py and /root/.jupyter/jupyter_notebook_config.json config files. /root/.jupyter/jupyter_notebook_config.json has higher priority: {
"NotebookApp": {
"password": "'123456' ignored, using 'sha1:f3bd4481664e:e213e841b4854685bcae350b836039389cd79cee'"
}
}
[D 17:14:33.069 NotebookApp] Looking for jupyter_notebook_config in /root
[D 17:14:33.073 NotebookApp] [nb_conda_kernels] refreshing conda info
WARNING: The conda.compat module is deprecated and will be removed in a future release.
[I 17:14:33.495 NotebookApp] [nb_conda_kernels] enabled, 3 kernels found
[D 17:14:33.505 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/etc/jupyter/jupyter_notebook_config.json
[D 17:14:33.506 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/usr/local/etc/jupyter/jupyter_notebook_config.json
[D 17:14:33.507 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/root/anaconda3/envs/my-rdkit-env/etc/jupyter/jupyter_notebook_config.json
[D 17:14:33.508 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/root/.jupyter/jupyter_notebook_config.json
[I 17:14:33.860 NotebookApp] [nb_conda] enabled
[I 17:14:33.861 NotebookApp] Serving notebooks from local directory: /root
[I 17:14:33.861 NotebookApp] The Jupyter Notebook is running at:
[I 17:14:33.861 NotebookApp] http://localhost.localdomain:8888/
[I 17:14:33.861 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 17:15:59.512 NotebookApp] 302 GET / (172.16.48.232) 1.19ms
[D 17:15:59.520 NotebookApp] Using contents: services/contents
[D 17:15:59.604 NotebookApp] Path base/images/favicon.ico served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/base/images/favicon.ico
[D 17:15:59.606 NotebookApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css
[D 17:15:59.606 NotebookApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/jquery-typeahead/dist/jquery.typeahead.min.css
[D 17:15:59.606 NotebookApp] Path style/style.min.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/style/style.min.css
[D 17:15:59.607 NotebookApp] Path components/es6-promise/promise.min.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/es6-promise/promise.min.js
[D 17:15:59.608 NotebookApp] Path components/react/react.production.min.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/react/react.production.min.js
[D 17:15:59.608 NotebookApp] Path components/react/react-dom.production.min.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/react/react-dom.production.min.js
[D 17:15:59.608 NotebookApp] Path components/create-react-class/index.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/create-react-class/index.js
[D 17:15:59.609 NotebookApp] Path components/requirejs/require.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/requirejs/require.js
[D 17:15:59.610 NotebookApp] Path base/images/logo.png served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/base/images/logo.png
[D 17:15:59.610 NotebookApp] Path tree/js/main.min.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/tree/js/main.min.js
[D 17:15:59.617 NotebookApp] 200 GET /tree? (172.16.48.232) 98.36ms
[D 17:15:59.654 NotebookApp] Path custom.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/custom/custom.css
[D 17:15:59.656 NotebookApp] 304 GET /custom/custom.css (172.16.48.232) 4.05ms
[D 17:16:00.290 NotebookApp] Path services/contents.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/services/contents.js
[D 17:16:00.291 NotebookApp] 200 GET /static/services/contents.js?v=20191105171433 (172.16.48.232) 1.77ms
[D 17:16:00.354 NotebookApp] Paths used for configuration of tree:
/etc/jupyter/nbconfig/tree.json
[D 17:16:00.356 NotebookApp] Paths used for configuration of tree:
/usr/local/etc/jupyter/nbconfig/tree.json
[D 17:16:00.357 NotebookApp] Paths used for configuration of tree:
/root/anaconda3/envs/my-rdkit-env/etc/jupyter/nbconfig/tree.json
[D 17:16:00.358 NotebookApp] Paths used for configuration of tree:
/root/.jupyter/nbconfig/tree.json
[D 17:16:00.359 NotebookApp] 200 GET /api/config/tree?=1572916567934 (172.16.48.232) 9.88ms
[D 17:16:00.362 NotebookApp] Paths used for configuration of common:
/etc/jupyter/nbconfig/common.json
[D 17:16:00.363 NotebookApp] Paths used for configuration of common:
/usr/local/etc/jupyter/nbconfig/common.json
[D 17:16:00.364 NotebookApp] Paths used for configuration of common:
/root/anaconda3/envs/my-rdkit-env/etc/jupyter/nbconfig/common.json
[D 17:16:00.365 NotebookApp] Paths used for configuration of common:
/root/.jupyter/nbconfig/common.json
[D 17:16:00.366 NotebookApp] 200 GET /api/config/common?
=1572916567935 (172.16.48.232) 5.56ms
[D 17:16:00.370 NotebookApp] Found kernel python3 in /root/anaconda3/envs/my-rdkit-env/share/jupyter/kernels
[D 17:16:00.371 NotebookApp] [nb_conda_kernels] refreshing conda info
WARNING: The conda.compat module is deprecated and will be removed in a future release.
[D 17:16:00.767 NotebookApp] 304 GET /api/kernelspecs (172.16.48.232) 398.96ms
[D 17:16:00.768 NotebookApp] 200 GET /api/terminals?=1572916567936 (172.16.48.232) 399.78ms
[D 17:16:00.777 NotebookApp] 200 GET /api/sessions?
=1572916567937 (172.16.48.232) 6.02ms
[D 17:16:00.777 NotebookApp] Path custom.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/custom/custom.js
[D 17:16:00.778 NotebookApp] 200 GET /custom/custom.js?v=20191105171433 (172.16.48.232) 6.30ms
[D 17:16:00.778 NotebookApp] Path nb_conda/tree.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/tree.js
[D 17:16:00.779 NotebookApp] 200 GET /nbextensions/nb_conda/tree.js?v=20191105171433 (172.16.48.232) 6.45ms
[D 17:16:00.781 NotebookApp] 200 GET /api/terminals?=1572916567938 (172.16.48.232) 1.06ms
[D 17:16:00.816 NotebookApp] 200 GET /api/contents?type=directory&
=1572916567939 (172.16.48.232) 6.96ms
[D 17:16:00.820 NotebookApp] Path nb_conda/models.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/models.js
[D 17:16:00.821 NotebookApp] 200 GET /nbextensions/nb_conda/models.js?v=20191105171433 (172.16.48.232) 1.80ms
[D 17:16:00.823 NotebookApp] Path nb_conda/views.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/views.js
[D 17:16:00.824 NotebookApp] 200 GET /nbextensions/nb_conda/views.js?v=20191105171433 (172.16.48.232) 2.53ms
[D 17:16:00.825 NotebookApp] Path nb_conda/urls.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/urls.js
[D 17:16:00.826 NotebookApp] 200 GET /nbextensions/nb_conda/urls.js?v=20191105171433 (172.16.48.232) 3.07ms
[D 17:16:00.898 NotebookApp] Path nb_conda/common.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/common.js
[D 17:16:00.899 NotebookApp] 200 GET /nbextensions/nb_conda/common.js?v=20191105171433 (172.16.48.232) 1.72ms
[D 17:16:00.916 NotebookApp] Path nb_conda/conda.css served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/conda.css
[D 17:16:00.916 NotebookApp] 304 GET /nbextensions/nb_conda/conda.css (172.16.48.232) 1.44ms
[D 17:16:00.918 NotebookApp] Path nb_conda/tab.html served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/tab.html
[D 17:16:00.919 NotebookApp] 304 GET /nbextensions/nb_conda/tab.html (172.16.48.232) 1.40ms
[D 17:16:36.131 NotebookApp] 200 GET /api/sessions?=1572916567940 (172.16.48.232) 1.53ms
[D 17:16:36.133 NotebookApp] 200 GET /api/terminals?
=1572916567941 (172.16.48.232) 1.25ms
[D 17:16:36.170 NotebookApp] 200 GET /api/contents?type=directory&=1572916567942 (172.16.48.232) 5.11ms
[D 17:16:44.535 NotebookApp] 200 GET /api/contents/test_dir?type=directory&
=1572916567943 (172.16.48.232) 3.86ms
[D 17:16:47.369 NotebookApp] Using contents: services/contents
[D 17:16:47.469 NotebookApp] Path base/images/favicon-notebook.ico served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/base/images/favicon-notebook.ico
[D 17:16:47.469 NotebookApp] Path components/bootstrap-tour/build/css/bootstrap-tour.min.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/bootstrap-tour/build/css/bootstrap-tour.min.css
[D 17:16:47.469 NotebookApp] Path components/codemirror/lib/codemirror.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/codemirror/lib/codemirror.css
[D 17:16:47.470 NotebookApp] Path notebook/css/override.css served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/notebook/css/override.css
[D 17:16:47.681 NotebookApp] Path components/text-encoding/lib/encoding.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/text-encoding/lib/encoding.js
[D 17:16:47.681 NotebookApp] Path notebook/js/main.min.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/notebook/js/main.min.js
[D 17:16:47.687 NotebookApp] 200 GET /notebooks/test_dir/rdkit.ipynb (172.16.48.232) 319.09ms
[D 17:16:47.752 NotebookApp] Path components/MathJax/MathJax.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/MathJax/MathJax.js
[D 17:16:47.753 NotebookApp] 304 GET /static/components/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,Safe&delayStartupUntil=configured (172.16.48.232) 1.77ms
[D 17:16:47.754 NotebookApp] 304 GET /custom/custom.css (172.16.48.232) 2.14ms
[D 17:16:47.932 NotebookApp] Path components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js
[D 17:16:47.933 NotebookApp] 304 GET /static/components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js?V=2.7.6 (172.16.48.232) 1.38ms
[D 17:16:47.982 NotebookApp] Path components/MathJax/config/Safe.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/MathJax/config/Safe.js
[D 17:16:47.983 NotebookApp] 304 GET /static/components/MathJax/config/Safe.js?V=2.7.6 (172.16.48.232) 1.43ms
[D 17:16:48.136 NotebookApp] Paths used for configuration of notebook:
/etc/jupyter/nbconfig/notebook.json
[D 17:16:48.137 NotebookApp] Paths used for configuration of notebook:
/usr/local/etc/jupyter/nbconfig/notebook.json
[D 17:16:48.138 NotebookApp] Paths used for configuration of notebook:
/root/anaconda3/envs/my-rdkit-env/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json
/root/anaconda3/envs/my-rdkit-env/etc/jupyter/nbconfig/notebook.json
[D 17:16:48.140 NotebookApp] Paths used for configuration of notebook:
/root/.jupyter/nbconfig/notebook.json
[D 17:16:48.141 NotebookApp] 200 GET /api/config/notebook?=1572916615681 (172.16.48.232) 6.31ms
[D 17:16:48.143 NotebookApp] Paths used for configuration of common:
/etc/jupyter/nbconfig/common.json
[D 17:16:48.145 NotebookApp] Paths used for configuration of common:
/usr/local/etc/jupyter/nbconfig/common.json
[D 17:16:48.146 NotebookApp] Paths used for configuration of common:
/root/anaconda3/envs/my-rdkit-env/etc/jupyter/nbconfig/common.json
[D 17:16:48.147 NotebookApp] Paths used for configuration of common:
/root/.jupyter/nbconfig/common.json
[D 17:16:48.147 NotebookApp] 200 GET /api/config/common?
=1572916615682 (172.16.48.232) 5.58ms
[D 17:16:48.166 NotebookApp] Path components/MathJax/extensions/MathML/content-mathml.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/MathML/content-mathml.js
[D 17:16:48.167 NotebookApp] 304 GET /static/components/MathJax/extensions/MathML/content-mathml.js?V=2.7.6 (172.16.48.232) 1.51ms
[D 17:16:48.198 NotebookApp] Found kernel python3 in /root/anaconda3/envs/my-rdkit-env/share/jupyter/kernels
[D 17:16:48.201 NotebookApp] 304 GET /api/kernelspecs (172.16.48.232) 3.58ms
[D 17:16:48.246 NotebookApp] 200 GET /api/contents/test_dir/rdkit.ipynb?type=notebook&=1572916615683 (172.16.48.232) 19.99ms
[D 17:16:48.249 NotebookApp] 304 GET /custom/custom.js?v=20191105171433 (172.16.48.232) 1.37ms
[D 17:16:48.252 NotebookApp] Path components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js
[D 17:16:48.253 NotebookApp] 304 GET /static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js?V=2.7.6 (172.16.48.232) 1.60ms
[D 17:16:48.262 NotebookApp] Path jupyter-js-widgets/extension.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/jupyter-js-widgets/extension.js
[D 17:16:48.264 NotebookApp] Path nb_conda/main.js served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/main.js
[D 17:16:48.265 NotebookApp] 200 GET /nbextensions/nb_conda/main.js?v=20191105171433 (172.16.48.232) 1.74ms
[D 17:16:48.326 NotebookApp] Path components/MathJax/extensions/Safe.js served from /root/anaconda3/envs/my-rdkit-env/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/Safe.js
[D 17:16:48.327 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?V=2.7.6 (172.16.48.232) 1.45ms
[D 17:16:48.422 NotebookApp] 200 GET /nbextensions/jupyter-js-widgets/extension.js?v=20191105171433 (172.16.48.232) 161.32ms
[D 17:16:48.603 NotebookApp] Starting kernel: ['/root/anaconda3/envs/my-rdkit-env/bin/python', '-m', 'ipykernel_launcher', '-f', '/root/.local/share/jupyter/runtime/kernel-f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669.json']
[D 17:16:48.612 NotebookApp] Connecting to: tcp://:34636
[D 17:16:48.615 NotebookApp] Connecting to: tcp://:44862
[I 17:16:48.619 NotebookApp] Kernel started: f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:16:48.619 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/root/test_dir'}
[D 17:16:48.621 NotebookApp] 201 POST /api/sessions (172.16.48.232) 56.14ms
[D 17:16:48.626 NotebookApp] 200 GET /api/contents/test_dir/rdkit.ipynb/checkpoints?
=1572916615684 (172.16.48.232) 3.42ms
[D 17:16:48.645 NotebookApp] 304 GET /nbextensions/nb_conda/models.js?v=20191105171433 (172.16.48.232) 1.51ms
[D 17:16:48.649 NotebookApp] 304 GET /nbextensions/nb_conda/views.js?v=20191105171433 (172.16.48.232) 1.30ms
[D 17:16:48.651 NotebookApp] 304 GET /nbextensions/nb_conda/urls.js?v=20191105171433 (172.16.48.232) 1.31ms
[D 17:16:48.726 NotebookApp] Initializing websocket connection /api/kernels/f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669/channels
[D 17:16:48.729 NotebookApp] Requesting kernel info from f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:16:48.729 NotebookApp] Connecting to: tcp://:37767
[D 17:16:48.836 NotebookApp] 304 GET /nbextensions/nb_conda/common.js?v=20191105171433 (172.16.48.232) 1.30ms
[D 17:16:48.866 NotebookApp] 304 GET /nbextensions/nb_conda/conda.css (172.16.48.232) 1.15ms
[D 17:16:48.869 NotebookApp] Path nb_conda/menu.html served from /root/anaconda3/envs/my-rdkit-env/share/jupyter/nbextensions/nb_conda/menu.html
[D 17:16:48.870 NotebookApp] 304 GET /nbextensions/nb_conda/menu.html (172.16.48.232) 1.45ms
[D 17:17:19.995 NotebookApp] 200 GET /api/sessions?=1572916567944 (172.16.48.232) 1.84ms
[D 17:17:20.002 NotebookApp] 200 GET /api/terminals?
=1572916567945 (172.16.48.232) 1.29ms
[D 17:17:20.069 NotebookApp] 200 GET /api/contents/test_dir?type=directory&_=1572916567946 (172.16.48.232) 3.96ms
[W 17:17:48.731 NotebookApp] Timeout waiting for kernel_info reply from f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:17:48.733 NotebookApp] 101 GET /api/kernels/f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669/channels?session_id=77f3e9738ba44a078cf968c2cc61bc17 (172.16.48.232) 60007.36ms
[D 17:17:48.733 NotebookApp] Opening websocket /api/kernels/f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669/channels
[D 17:17:48.734 NotebookApp] Getting buffer for f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:17:48.734 NotebookApp] Connecting to: tcp://:37767
[D 17:17:48.734 NotebookApp] Connecting to: tcp://:34636
[D 17:17:48.735 NotebookApp] Connecting to: tcp://:44862
[D 17:17:48.735 NotebookApp] Connecting to: tcp://:60515

@kevin-bates
Copy link
Member

@xh22 - thank you for the complete console. Here are the "interesting" aspects...

[D 17:14:33.073 NotebookApp] [nb_conda_kernels] refreshing conda info
WARNING: The conda.compat module is deprecated and will be removed in a future release.
[I 17:14:33.495 NotebookApp] [nb_conda_kernels] enabled, 3 kernels found
...
[D 17:16:48.603 NotebookApp] Starting kernel: ['/root/anaconda3/envs/my-rdkit-env/bin/python', '-m', 'ipykernel_launcher', '-f', '/root/.local/share/jupyter/runtime/kernel-f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669.json']
[D 17:16:48.612 NotebookApp] Connecting to: tcp://:34636
[D 17:16:48.615 NotebookApp] Connecting to: tcp://:44862
[I 17:16:48.619 NotebookApp] Kernel started: f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:16:48.619 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/root/test_dir'}
[D 17:16:48.621 NotebookApp] 201 POST /api/sessions (172.16.48.232) 56.14ms
[D 17:16:48.726 NotebookApp] Initializing websocket connection /api/kernels/f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669/channels
[D 17:16:48.729 NotebookApp] Requesting kernel info from f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:16:48.729 NotebookApp] Connecting to: tcp://:37767
...
[W 17:17:48.731 NotebookApp] Timeout waiting for kernel_info reply from f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669
[D 17:17:48.733 NotebookApp] 101 GET /api/kernels/f4d9a8b3-ef52-4c5b-b675-82ec5c8d3669/channels?session_id=77f3e9738ba44a078cf968c2cc61bc17 (172.16.48.232) 60007.36ms

I suspect this has something to do with nb_conda_kernels - of which I'm not familiar as I've never used them - but have heard disparaging stories about. I'm not sure how to go about troubleshooting them, but its clear the launched kernel is not responding.

Perhaps someone else has ideas? I'm copying a few others that I've seen on threads dealing with conda kernels - hopefully they'll have some ideas or provide links to previous solutions. @takluyver @blink1073 @Carreau

One thing you might try is re-installing nb-conda-kernels and/or creating another env. I don't know what the scope of nb-conda-kernels is - whether they span all conda envs or are specific to a particular env - but if you can uninstall them, you could try installing ipykernel and use that from Notebook.

I apologize for not being able to help you further.

@xh22
Copy link

xh22 commented Nov 5, 2019

(test) [root@localhost ~]# jupyter notebook --allow-root --debug
[D 21:03:42.404 NotebookApp] Searching ['/root', '/root/.jupyter', '/root/anaconda3/envs/test/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 21:03:42.405 NotebookApp] Looking for jupyter_config in /etc/jupyter
[D 21:03:42.405 NotebookApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 21:03:42.405 NotebookApp] Looking for jupyter_config in /root/anaconda3/envs/test/etc/jupyter
[D 21:03:42.405 NotebookApp] Looking for jupyter_config in /root/.jupyter
[D 21:03:42.405 NotebookApp] Looking for jupyter_config in /root
[D 21:03:42.406 NotebookApp] Looking for jupyter_notebook_config in /etc/jupyter
[D 21:03:42.406 NotebookApp] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 21:03:42.407 NotebookApp] Looking for jupyter_notebook_config in /root/anaconda3/envs/test/etc/jupyter
[D 21:03:42.407 NotebookApp] Looking for jupyter_notebook_config in /root/.jupyter
[D 21:03:42.407 NotebookApp] Loaded config file: /root/.jupyter/jupyter_notebook_config.py
[D 21:03:42.408 NotebookApp] Loaded config file: /root/.jupyter/jupyter_notebook_config.json
[W 21:03:42.408 NotebookApp] Collisions detected in /root/.jupyter/jupyter_notebook_config.py and /root/.jupyter/jupyter_notebook_config.json config files. /root/.jupyter/jupyter_notebook_config.json has higher priority: {
"NotebookApp": {
"password": "'123456' ignored, using 'sha1:f3bd4481664e:e213e841b4854685bcae350b836039389cd79cee'"
}
}
[D 21:03:42.408 NotebookApp] Looking for jupyter_notebook_config in /root
[D 21:03:42.414 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/etc/jupyter/jupyter_notebook_config.json
[D 21:03:42.415 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/usr/local/etc/jupyter/jupyter_notebook_config.json
[D 21:03:42.415 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/root/anaconda3/envs/test/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
/root/anaconda3/envs/test/etc/jupyter/jupyter_notebook_config.json
[D 21:03:42.416 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/root/.jupyter/jupyter_notebook_config.json
[I 21:03:42.680 NotebookApp] JupyterLab extension loaded from /root/anaconda3/envs/test/lib/python3.6/site-packages/jupyterlab
[I 21:03:42.680 NotebookApp] JupyterLab application directory is /root/anaconda3/envs/test/share/jupyter/lab
[I 21:03:42.682 NotebookApp] Serving notebooks from local directory: /root
[I 21:03:42.682 NotebookApp] The Jupyter Notebook is running at:
[I 21:03:42.682 NotebookApp] http://localhost.localdomain:8888/
[I 21:03:42.682 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[D 21:03:45.050 NotebookApp] 200 GET /api/terminals?=1572916567971 (172.16.48.232) 3.27ms
[D 21:03:45.053 NotebookApp] 200 GET /api/sessions?=1572916567970 (172.16.48.232) 4.98ms
[D 21:03:45.127 NotebookApp] 200 GET /api/contents/test_dir?type=directory&=1572916567972 (172.16.48.232) 5.83ms
[D 21:03:46.206 NotebookApp] Using contents: services/contents
[D 21:03:46.323 NotebookApp] Path base/images/favicon-notebook.ico served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/base/images/favicon-notebook.ico
[D 21:03:46.323 NotebookApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css
[D 21:03:46.324 NotebookApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/jquery-typeahead/dist/jquery.typeahead.min.css
[D 21:03:46.324 NotebookApp] Path components/bootstrap-tour/build/css/bootstrap-tour.min.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/bootstrap-tour/build/css/bootstrap-tour.min.css
[D 21:03:46.324 NotebookApp] Path components/codemirror/lib/codemirror.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/codemirror/lib/codemirror.css
[D 21:03:46.324 NotebookApp] Path style/style.min.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/style/style.min.css
[D 21:03:46.325 NotebookApp] Path notebook/css/override.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/notebook/css/override.css
[D 21:03:46.326 NotebookApp] Path components/es6-promise/promise.min.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/es6-promise/promise.min.js
[D 21:03:46.326 NotebookApp] Path components/react/react.production.min.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/react/react.production.min.js
[D 21:03:46.326 NotebookApp] Path components/react/react-dom.production.min.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/react/react-dom.production.min.js
[D 21:03:46.326 NotebookApp] Path components/create-react-class/index.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/create-react-class/index.js
[D 21:03:46.327 NotebookApp] Path components/requirejs/require.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/requirejs/require.js
[D 21:03:46.327 NotebookApp] Path base/images/logo.png served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/base/images/logo.png
[D 21:03:46.584 NotebookApp] Path components/text-encoding/lib/encoding.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/text-encoding/lib/encoding.js
[D 21:03:46.585 NotebookApp] Path notebook/js/main.min.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/notebook/js/main.min.js
[D 21:03:46.592 NotebookApp] 200 GET /notebooks/test_dir/rdkit.ipynb (172.16.48.232) 387.11ms
[D 21:03:46.731 NotebookApp] Path components/MathJax/MathJax.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/MathJax/MathJax.js
[D 21:03:46.733 NotebookApp] 304 GET /static/components/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,Safe&delayStartupUntil=configured (172.16.48.232) 3.71ms
[D 21:03:46.734 NotebookApp] Path custom.css served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/custom/custom.css
[D 21:03:46.735 NotebookApp] 304 GET /custom/custom.css (172.16.48.232) 1.52ms
[D 21:03:46.882 NotebookApp] Path components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js
[D 21:03:46.883 NotebookApp] 304 GET /static/components/MathJax/config/TeX-AMS-MML_HTMLorMML-full.js?V=2.7.6 (172.16.48.232) 1.59ms
[D 21:03:46.963 NotebookApp] Path services/contents.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/services/contents.js
[D 21:03:46.964 NotebookApp] 200 GET /static/services/contents.js?v=20191105210342 (172.16.48.232) 1.73ms
[D 21:03:47.025 NotebookApp] Path components/MathJax/config/Safe.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/MathJax/config/Safe.js
[D 21:03:47.025 NotebookApp] 304 GET /static/components/MathJax/config/Safe.js?V=2.7.6 (172.16.48.232) 1.46ms
[D 21:03:47.030 NotebookApp] Paths used for configuration of notebook:
/etc/jupyter/nbconfig/notebook.json
[D 21:03:47.031 NotebookApp] Paths used for configuration of notebook:
/usr/local/etc/jupyter/nbconfig/notebook.json
[D 21:03:47.032 NotebookApp] Paths used for configuration of notebook:
/root/anaconda3/envs/test/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json
/root/anaconda3/envs/test/etc/jupyter/nbconfig/notebook.json
[D 21:03:47.033 NotebookApp] Paths used for configuration of notebook:
/root/.jupyter/nbconfig/notebook.json
[D 21:03:47.034 NotebookApp] 200 GET /api/config/notebook?=1572930234463 (172.16.48.232) 7.60ms
[D 21:03:47.038 NotebookApp] Paths used for configuration of common:
/etc/jupyter/nbconfig/common.json
[D 21:03:47.039 NotebookApp] Paths used for configuration of common:
/usr/local/etc/jupyter/nbconfig/common.json
[D 21:03:47.040 NotebookApp] Paths used for configuration of common:
/root/anaconda3/envs/test/etc/jupyter/nbconfig/common.json
[D 21:03:47.041 NotebookApp] Paths used for configuration of common:
/root/.jupyter/nbconfig/common.json
[D 21:03:47.042 NotebookApp] 200 GET /api/config/common?=1572930234464 (172.16.48.232) 5.45ms
[D 21:03:47.075 NotebookApp] Found kernel python3 in /root/anaconda3/envs/test/share/jupyter/kernels
[D 21:03:47.081 NotebookApp] 304 GET /api/kernelspecs (172.16.48.232) 7.97ms
[D 21:03:47.109 NotebookApp] 200 GET /api/contents/test_dir/rdkit.ipynb?type=notebook&=1572930234465 (172.16.48.232) 22.58ms
[D 21:03:47.111 NotebookApp] Path custom.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/custom/custom.js
[D 21:03:47.112 NotebookApp] 200 GET /custom/custom.js?v=20191105210342 (172.16.48.232) 1.95ms
[D 21:03:47.136 NotebookApp] Path jupyter-js-widgets/extension.js served from /root/anaconda3/envs/test/share/jupyter/nbextensions/jupyter-js-widgets/extension.js
[D 21:03:47.174 NotebookApp] Path components/MathJax/extensions/MathML/content-mathml.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/MathML/content-mathml.js
[D 21:03:47.174 NotebookApp] 304 GET /static/components/MathJax/extensions/MathML/content-mathml.js?V=2.7.6 (172.16.48.232) 1.47ms
[D 21:03:47.380 NotebookApp] Starting kernel: ['/root/anaconda3/envs/test/bin/python', '-m', 'ipykernel_launcher', '-f', '/run/user/0/jupyter/kernel-425ab218-76c9-4bb0-b6e2-fb3b90565c03.json']
[D 21:03:47.389 NotebookApp] Connecting to: tcp://:48108
[D 21:03:47.392 NotebookApp] Connecting to: tcp://:39233
[I 21:03:47.396 NotebookApp] Kernel started: 425ab218-76c9-4bb0-b6e2-fb3b90565c03
[D 21:03:47.396 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/root/test_dir'}
[D 21:03:47.398 NotebookApp] 201 POST /api/sessions (172.16.48.232) 55.70ms
[D 21:03:47.402 NotebookApp] 200 GET /api/contents/test_dir/rdkit.ipynb/checkpoints?_=1572930234466 (172.16.48.232) 58.44ms
[D 21:03:47.411 NotebookApp] 200 GET /nbextensions/jupyter-js-widgets/extension.js?v=20191105210342 (172.16.48.232) 275.37ms
[D 21:03:47.413 NotebookApp] Path components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js
[D 21:03:47.414 NotebookApp] 304 GET /static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js?V=2.7.6 (172.16.48.232) 2.03ms
[D 21:03:47.475 NotebookApp] Path components/MathJax/extensions/Safe.js served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/Safe.js
[D 21:03:47.476 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?V=2.7.6 (172.16.48.232) 1.44ms
[D 21:03:47.695 NotebookApp] Initializing websocket connection /api/kernels/425ab218-76c9-4bb0-b6e2-fb3b90565c03/channels
[D 21:03:47.698 NotebookApp] Requesting kernel info from 425ab218-76c9-4bb0-b6e2-fb3b90565c03
[D 21:03:47.698 NotebookApp] Connecting to: tcp://:39586
[D 21:03:48.512 NotebookApp] Path base/images/favicon-busy-1.ico served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/base/images/favicon-busy-1.ico
[D 21:03:48.513 NotebookApp] 304 GET /static/base/images/favicon-busy-1.ico (172.16.48.232) 1.56ms
[W 21:04:47.700 NotebookApp] Timeout waiting for kernel_info reply from 425ab218-76c9-4bb0-b6e2-fb3b90565c03
[D 21:04:47.701 NotebookApp] 101 GET /api/kernels/425ab218-76c9-4bb0-b6e2-fb3b90565c03/channels?session_id=3711cc0e8ba1407f8b472c791bc4d775 (172.16.48.232) 60007.49ms
[D 21:04:47.702 NotebookApp] Opening websocket /api/kernels/425ab218-76c9-4bb0-b6e2-fb3b90565c03/channels
[D 21:04:47.702 NotebookApp] Getting buffer for 425ab218-76c9-4bb0-b6e2-fb3b90565c03
[D 21:04:47.703 NotebookApp] Connecting to: tcp://:39586
[D 21:04:47.703 NotebookApp] Connecting to: tcp://:48108
[D 21:04:47.704 NotebookApp] Connecting to: tcp://:39233
[D 21:04:47.705 NotebookApp] Connecting to: tcp://:45585
[D 21:04:47.961 NotebookApp] Initializing websocket connection /api/kernels/db32acf9-77e3-4467-b93a-38b8ec9f324e/channels
[W 21:04:47.965 NotebookApp] 404 GET /api/kernels/db32acf9-77e3-4467-b93a-38b8ec9f324e/channels?session_id=b5280c24342b49a6a515b1df07a9bdb9 (172.16.48.232): Kernel does not exist: db32acf9-77e3-4467-b93a-38b8ec9f324e
[D 21:04:47.965 NotebookApp] Using contents: services/contents
[D 21:04:47.982 NotebookApp] Path base/images/favicon.ico served from /root/anaconda3/envs/test/lib/python3.6/site-packages/notebook/static/base/images/favicon.ico
[W 21:04:47.983 NotebookApp] 404 GET /api/kernels/db32acf9-77e3-4467-b93a-38b8ec9f324e/channels?session_id=b5280c24342b49a6a515b1df07a9bdb9 (172.16.48.232) 22.24ms referer=None

thank u for your reply, i changed a env still get this error

@kapilg1997
Copy link

Jupyter notebook not connecting to kernel in virtual environment. Have reinstalled Anaconda, jupyter notebook repeatedly. Worked on different browsers - Chrome, Firefox, Edge
Python: 3.7
Anaconda: 4.7.12
Tornado: 5.1.1(tried with 6.0.3 but still not connecting.)

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.

and on anaconda prompt
RuntimeError: This event loop is already running
[W 01:43:14.974 NotebookApp] KernelRestarter: restart failed
[W 01:43:14.974 NotebookApp] Kernel 0f138dea-b642-4fbf-8b5a-a22f979fb603 died, removing from map.
[W 01:43:21.140 NotebookApp] Replacing stale connection: 0f138dea-b642-4fbf-8b5a-a22f979fb603:756a070714d04866bc9f5c7f600db245
[W 01:43:43.185 NotebookApp] Replacing stale connection: 0f138dea-b642-4fbf-8b5a-a22f979fb603:756a070714d04866bc9f5c7f600db245
[W 01:44:00.144 NotebookApp] Timeout waiting for kernel_info reply from 0f138dea-b642-4fbf-8b5a-a22f979fb603
[E 01:44:00.146 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 0f138dea-b642-4fbf-8b5a-a22f979fb603)
[W 01:44:00.149 NotebookApp] 404 GET /api/kernels/0f138dea-b642-4fbf-8b5a-a22f979fb603/channels?session_id=756a070714d04866bc9f5c7f600db245 (::1): Kernel does not exist: 0f138dea-b642-4fbf-8b5a-a22f979fb603
[W 01:44:00.161 NotebookApp] 404 GET /api/kernels/0f138dea-b642-4fbf-8b5a-a22f979fb603/channels?session_id=756a070714d04866bc9f5c7f600db245 (::1) 39023.48ms referer=None
[W 01:44:00.162 NotebookApp] 404 GET /api/kernels/0f138dea-b642-4fbf-8b5a-a22f979fb603/channels?session_id=756a070714d04866bc9f5c7f600db245 (::1): Kernel does not exist: 0f138dea-b642-4fbf-8b5a-a22f979fb603
[W 01:44:00.165 NotebookApp] 404 GET /api/kernels/0f138dea-b642-4fbf-8b5a-a22f979fb603/channels?session_id=756a070714d04866bc9f5c7f600db245 (::1) 16983.47ms referer=None
[W 01:44:04.177 NotebookApp] Replacing stale connection: 0f138dea-b642-4fbf-8b5a-a22f979fb603:756a070714d04866bc9f5c7f600db245

Error Message: Kernel doesn't exist.
But Kernel has been created.

@seewishnew
Copy link

seewishnew commented Feb 15, 2020

I got the following error messages once I removed SSL certificate paths from config file:

Uncaught exception GET /api/kernels/75d3fc32-cabb-43ea-af5f-e67591e90c7a/channels?session_id=6e9313c388bf4e768b6016ed049163d3 (172.31.55.192)
HTTPServerRequest(protocol='http', host='128.237.146.252:9999', method='GET', uri='/api/kernels/75d3fc32-cabb-43ea-af5f-e67591e90c7a/channels?session_id=6e9313c388bf4e768b6016ed049163d3', version='HTTP/1.1', remote_ip='172.31.55.192')
Traceback (most recent call last):
File "/Users/vishnuc/anaconda3/lib/python3.7/site-packages/tornado/websocket.py", line 956, in accept_connection
open_result = handler.open(*handler.open_args, **handler.open_kwargs)
File "/Users/vishnuc/anaconda3/lib/python3.7/site-packages/notebook/services/kernels/handlers.py", line 274, in open
self.create_stream()
File "/Users/vishnuc/anaconda3/lib/python3.7/site-packages/notebook/services/kernels/handlers.py", line 127, in create_stream
meth = getattr(km, 'connect
' + channel)
AttributeError: 'MappingKernelManager' object has no attribute 'connect_control'

Turns out this is a tornado issue. I upgraded to tornado v6.0.3 and it starts working again.

@ankitAMD
Copy link

ankitAMD commented Feb 28, 2020

@seewishnew please help and explain in detail how you solve this ??????. my tornado is upgraded version .....
my error>>>>>>>>>>>>>>>>>>>>>..
thtrieu/darkflow#1147

@kimish96
Copy link

Please help me with this error , when I create a new notebook using jupyter I get this error.
I am using python 3.8 and windows 10

C:\Users\kimish.DESKTOP-PT5P6T3>jupyter notebook
[W 14:48:24.922 NotebookApp] Terminals not available (error was No module named 'winpty.cywinpty')
[I 14:48:25.129 NotebookApp] JupyterLab extension loaded from c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\jupyterlab
[I 14:48:25.129 NotebookApp] JupyterLab application directory is c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\share\jupyter\lab
[I 14:48:25.134 NotebookApp] Serving notebooks from local directory: C:\Users\kimish.DESKTOP-PT5P6T3
[I 14:48:25.134 NotebookApp] The Jupyter Notebook is running at:
[I 14:48:25.134 NotebookApp] http://localhost:8888/?token=ff0ac09771a1203a76ab291a8d89d8677fcc932075140e7d
[I 14:48:25.135 NotebookApp] or http://127.0.0.1:8888/?token=ff0ac09771a1203a76ab291a8d89d8677fcc932075140e7d
[I 14:48:25.135 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:48:25.178 NotebookApp]

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

[I 14:48:37.136 NotebookApp] Creating new notebook in
[W 14:48:38.613 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200411144824 (::1) 37.90ms referer=http://localhost:8888/notebooks/Untitled12.ipynb?kernel_name=python3
[I 14:48:38.797 NotebookApp] Kernel started: 34ab8f86-f841-4692-bd38-04bce7ecfdf4
Traceback (most recent call last):
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\ipykernel_launcher.py", line 15, in
from ipykernel import kernelapp as app
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\ipykernel_init
.py", line 2, in
from .connect import *
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\ipykernel\connect.py", line 13, in
from IPython.core.profiledir import ProfileDir
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\IPython_init
.py", line 55, in
from .core.application import Application
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\IPython\core\application.py", line 18, in
import logging
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\logging_init.py", line 28, in
from string import Template
File "C:\Users\kimish.DESKTOP-PT5P6T3\string.py", line 1, in
import pandas as pd
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\pandas_init_.py", line 180, in
import pandas.testing
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\pandas\testing.py", line 5, in
from pandas.testing import (
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\pandas_testing.py", line 404, in
RANDS_CHARS = np.array(list(string.ascii_letters + string.digits), dtype=(np.str
, 1))
AttributeError: partially initialized module 'string' has no attribute 'ascii_letters' (most likely due to a circular import)
[I 14:48:41.774 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\ipykernel_launcher.py", line 15, in
from ipykernel import kernelapp as app
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\ipykernel_init
.py", line 2, in
from .connect import *
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\ipykernel\connect.py", line 13, in
from IPython.core.profiledir import ProfileDir
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\IPython_init
.py", line 55, in
from .core.application import Application
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\IPython\core\application.py", line 18, in
import logging
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\logging_init.py", line 28, in
from string import Template
File "C:\Users\kimish.DESKTOP-PT5P6T3\string.py", line 1, in
import pandas as pd
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\pandas_init_.py", line 180, in
import pandas.testing
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\pandas\testing.py", line 5, in
from pandas.testing import (
File "c:\users\kimish.desktop-pt5p6t3\appdata\local\programs\python\python38-32\lib\site-packages\pandas_testing.py", line 404, in
RANDS_CHARS = np.array(list(string.ascii_letters + string.digits), dtype=(np.str
, 1))
AttributeError: partially initialized module 'string' has no attribute 'ascii_letters' (most likely due to a circular import)

@kevin-bates
Copy link
Member

Hi @kimish96 - your local string.py file: C:\Users\kimish.DESKTOP-PT5P6T3\string.py is introducing a collision with the built-in string class. Try renaming this file (and corresponding import statements).

@kimish96
Copy link

Thanks Bro, This was a big help...struggling since a week.

@Dipon12
Copy link

Dipon12 commented Jun 18, 2020

I am facing the same issue:- A connection to the notebook server cannot be established.
This is my Notebook Console output:-

[I 20:42:22.292 NotebookApp] JupyterLab extension loaded from C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab
[I 20:42:22.292 NotebookApp] JupyterLab application directory is C:\ProgramData\Anaconda3\share\jupyter\lab
[I 20:42:22.306 NotebookApp] Serving notebooks from local directory: C:\Users\ASUS
[I 20:42:22.306 NotebookApp] The Jupyter Notebook is running at:
[I 20:42:22.307 NotebookApp] http://localhost:8888/?token=51a370518615cdbdd0214161242d889df6b85a0755cd8de0
[I 20:42:22.307 NotebookApp]  or http://127.0.0.1:8888/?token=51a370518615cdbdd0214161242d889df6b85a0755cd8de0
[I 20:42:22.307 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 20:42:22.359 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/ASUS/AppData/Roaming/jupyter/runtime/nbserver-13988-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=51a370518615cdbdd0214161242d889df6b85a0755cd8de0
     or http://127.0.0.1:8888/?token=51a370518615cdbdd0214161242d889df6b85a0755cd8de0
[I 20:42:50.280 NotebookApp] Kernel started: 2bda97f0-0c78-4f38-9748-56d6175ccebc
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 21, in <module>
    from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text'
[I 20:42:53.261 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 21, in <module>
    from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text'
[I 20:42:56.271 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 21, in <module>
    from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text'
[I 20:42:59.276 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 21, in <module>
    from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text'
[I 20:43:02.273 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 21, in <module>
    from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text'
[W 20:43:05.276 NotebookApp] KernelRestarter: restart failed
[W 20:43:05.277 NotebookApp] Kernel 2bda97f0-0c78-4f38-9748-56d6175ccebc died, removing from map.
[W 20:43:11.376 NotebookApp] Replacing stale connection: 2bda97f0-0c78-4f38-9748-56d6175ccebc:390a1f0e1d724f7a846210537c60ec96
[W 20:43:33.412 NotebookApp] Replacing stale connection: 2bda97f0-0c78-4f38-9748-56d6175ccebc:390a1f0e1d724f7a846210537c60ec96

And this is my Firefox Console Output:-

Loaded moment locale en bidi.js:19
load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", … }
utils.js:60
Session: kernel_created (bca3d5a1-6a3b-4215-ad68-58865c0dece0) session.js:54
Starting WebSockets: ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc kernel.js:462
Loading extension: jupyter-js-widgets/extension utils.js:37
Firefox can’t establish a connection to the server at ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc/channels?session_id=390a1f0e1d724f7a846210537c60ec96. kernel.js:464
Kernel: kernel_disconnected (2bda97f0-0c78-4f38-9748-56d6175ccebc) kernel.js:106
WebSocket connection failed:  ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc true kernel.js:545
Connection lost, reconnecting in 1 seconds. kernel.js:563
WebSocket closed unexpectedly 
close { target: WebSocket, isTrusted: true, wasClean: false, code: 1006, reason: "", srcElement: WebSocket, eventPhase: 0, bubbles: false, cancelable: false, returnValue: true, … }
kernel.js:492
Kernel: kernel_reconnecting (2bda97f0-0c78-4f38-9748-56d6175ccebc) kernel.js:106
Starting WebSockets: ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc kernel.js:462
Firefox can’t establish a connection to the server at ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc/channels?session_id=390a1f0e1d724f7a846210537c60ec96. kernel.js:464
Kernel: kernel_disconnected (2bda97f0-0c78-4f38-9748-56d6175ccebc) kernel.js:106
WebSocket connection failed:  ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc true kernel.js:545
Connection lost, reconnecting in 2 seconds. kernel.js:563
WebSocket closed unexpectedly 
close { target: WebSocket, isTrusted: true, wasClean: false, code: 1006, reason: "", srcElement: WebSocket, eventPhase: 0, bubbles: false, cancelable: false, returnValue: true, … }
kernel.js:492
Kernel: kernel_reconnecting (2bda97f0-0c78-4f38-9748-56d6175ccebc) kernel.js:106
Starting WebSockets: ws://localhost:8888/api/kernels/2bda97f0-0c78-4f38-9748-56d6175ccebc

Desperately seeking for help.

@kevin-bates
Copy link
Member

This appears to be a duplicate of #4050, but rather than downgrade ipykernel and IPython, especially given the age of those responses, I would first try ensuring that you're running the latest versions of each and upgrade if not.

Also, since IPython appears to be sensitive to the version of prompt_toolkit, I would recommend checking prompt_toolkit's version as well.

@Dipon12
Copy link

Dipon12 commented Jun 18, 2020

thnx @kevin-bates . It helped. Notebook is working fine now

@kevin-bates
Copy link
Member

Glad to hear that @Dipon12. Could you please share the approach you took? If you found the downgrade to work, was that after attempting the upgrade approach? Thank you.

@wbadry
Copy link

wbadry commented Jun 25, 2020

Hello,
I ran into the same problem today. Just like @kevin-bates mentioned. You should always look for the prerequisite packages and upgrade them (or uninstall all of them and install notebook to grab the best version matching.

For current release notebook-6.0.3

ipykernel-5.3.0
ipython-7.15.0
jupyter-client-6.1.3
jupyter-core-4.6.3
tornado-6.0.4

Hope it helps

@fedeturi
Copy link

fedeturi commented Jul 2, 2020

Hello!

I am struggling with the same problem, checked many different solutions on the internet, tried them all, even uninstalling Anaconda and reinstalling, and it does not seem to work with any of these solutions.

This is what I get from the console.

`
(base) C:\Users\PC02>jupyter-notebook
[I 17:49:22.201 NotebookApp] Serving notebooks from local directory: C:\Users\PC02
[I 17:49:22.201 NotebookApp] 0 active kernels
[I 17:49:22.201 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=4d3c5cdfbe05ead068f3b18bc6a4248effd952f5fe74050d
[I 17:49:22.201 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 17:49:22.278 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?token=4d3c5cdfbe05ead068f3b18bc6a4248effd952f5fe74050d

[I 17:49:22.528 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[W 17:49:27.165 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200702174921 (::1) 16.95ms referer=http://localhost:8888/notebooks/Untitled.ipynb
[I 17:49:27.426 NotebookApp] Kernel started: 64e1f1ca-8f10-4995-8170-a8a3f56d0847
C:\Users\PC02\AppData\Roaming\Python\Python37\site-packages\notebook\base\zmqhandlers.py:292: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
[W 17:49:29.466 NotebookApp] Replacing stale connection: 64e1f1ca-8f10-4995-8170-a8a3f56d0847:D9F2455DAFA4402381AC2B5512679652
`

It was working yesterday, and apparently stopped after installing PyCharm, what seems wired.

This is mi office workstation so I am stucked and would appreciate the help.

@kevin-bates
Copy link
Member

Hi @fedeturi - this issue is different from the others and I think it might require a change. What I'm confused about is why this hasn't popped up until now. Could you please provide the output of pip freeze from within the Python environment that is producing this exception? Thank you.

@drewlr
Copy link

drewlr commented Jul 3, 2020

If it can help @kevin-bates - I ran into similar issues as above, and eventually got to @fedeturi's error.

What happened
the original issue was caused by using pip in a conda environment to install some unrelated package (google.colab), which then messed up the jupyter installation (with some different versions of six, tornado, ipython, notebook, ipykernel).

This caused errors similar to the others in the thread above.

Installing and uninstalling jupyter got me to the same issue as @fedeturi.

Eventually what fixed it for me was to:

  • remove manually all the above packages with pip uninstall
  • remove also jupyter_contrib_nbextensions
  • running a conda uninstall jupyter notebook

and then re-installing jupyter and jupyter_contrib_nbextensions with conda.

@KennyLeung
Copy link

If you are using a reverse proxy like nginx, you should consider whether the reverse proxy directive is set correctly.

I had the same problem, and after I finally set up nginx correctly by referring to this article, everything worked fine.

reference: https://www.cnblogs.com/lcword/p/15544380.html

@stephencb96
Copy link

I am having the same issue - tried uninstalling, reinstalling and changing tornado versions. Attached is terminal output... @kevin-bates any shot you can help?
(base) C:\Users\stephen.bonacci>jupyter kernelspec list
Available kernels:
my_env C:\Users\stephen.bonacci\AppData\Roaming\jupyter\kernels\my_env
python3 C:\Users\stephen.bonacci\Anaconda3\share\jupyter\kernels\python3

(base) C:\Users\stephen.bonacci>jupyter lab
NumExpr defaulting to 8 threads.
[I 2022-10-14 13:28:23.749 ServerApp] jupyterlab | extension was successfully linked.
[I 2022-10-14 13:28:24.202 ServerApp] nbclassic | extension was successfully linked.
[I 2022-10-14 13:28:24.202 ServerApp] panel.io.jupyter_server_extension | extension was successfully linked.
[I 2022-10-14 13:28:24.300 ServerApp] nbclassic | extension was successfully loaded.
[I 2022-10-14 13:28:24.302 LabApp] JupyterLab extension loaded from C:\Users\stephen.bonacci\Anaconda3\lib\site-packages\jupyterlab
[I 2022-10-14 13:28:24.303 LabApp] JupyterLab application directory is C:\Users\stephen.bonacci\Anaconda3\share\jupyter\lab
[I 2022-10-14 13:28:24.309 ServerApp] jupyterlab | extension was successfully loaded.
/panel-preview/ /panel-preview
[I 2022-10-14 13:28:24.312 ServerApp] panel.io.jupyter_server_extension | extension was successfully loaded.
[I 2022-10-14 13:28:24.313 ServerApp] The port 8888 is already in use, trying another port.
[I 2022-10-14 13:28:24.315 ServerApp] Serving notebooks from local directory: C:\Users\stephen.bonacci
[I 2022-10-14 13:28:24.315 ServerApp] Jupyter Server 1.13.5 is running at:
[I 2022-10-14 13:28:24.316 ServerApp] http://localhost:8889/lab?token=e4b82b055f39ff980ad19e432534a4add1f65e15c5c244aa
[I 2022-10-14 13:28:24.317 ServerApp] or http://127.0.0.1:8889/lab?token=e4b82b055f39ff980ad19e432534a4add1f65e15c5c244aa
[I 2022-10-14 13:28:24.317 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-10-14 13:28:24.380 ServerApp]

To access the server, open this file in a browser:
    file:///C:/Users/stephen.bonacci/AppData/Roaming/jupyter/runtime/jpserver-16912-open.html
Or copy and paste one of these URLs:
    http://localhost:8889/lab?token=e4b82b055f39ff980ad19e432534a4add1f65e15c5c244aa
 or http://127.0.0.1:8889/lab?token=e4b82b055f39ff980ad19e432534a4add1f65e15c5c244aa

[W 2022-10-14 13:28:29.305 LabApp] Could not determine jupyterlab build status without nodejs
[I 2022-10-14 13:28:34.832 ServerApp] Kernel started: 0c7e8334-2d31-41b8-97d0-2d8efa8d9630
[I 2022-10-14 13:28:37.805 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
[I 2022-10-14 13:28:40.838 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
[I 2022-10-14 13:28:43.851 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (3/5), new random ports
[I 2022-10-14 13:28:46.872 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (4/5), new random ports
[W 2022-10-14 13:28:49.915 ServerApp] AsyncIOLoopKernelRestarter: restart failed
[W 2022-10-14 13:28:49.915 ServerApp] Kernel 0c7e8334-2d31-41b8-97d0-2d8efa8d9630 died, removing from map.
[W 2022-10-14 13:29:36.596 ServerApp] Timeout waiting for kernel_info reply from 0c7e8334-2d31-41b8-97d0-2d8efa8d9630
[W 2022-10-14 13:29:36.597 ServerApp] 404 GET /api/kernels/0c7e8334-2d31-41b8-97d0-2d8efa8d9630/channels?session_id=bbca19dd-9a1e-4870-bbcd-60ed7b0d32ad (::1): Kernel does not exist: 0c7e8334-2d31-41b8-97d0-2d8efa8d9630
[W 2022-10-14 13:29:36.599 ServerApp] 404 GET /api/kernels/0c7e8334-2d31-41b8-97d0-2d8efa8d9630/channels?session_id=582bf011-19b5-4001-abb6-fba6ecc7460b (127.0.0.1): Kernel does not exist: 0c7e8334-2d31-41b8-97d0-2d8efa8d9630

@kevin-bates
Copy link
Member

Hi @stephencb96. The fact that the restarter is kicking in indicates that the process used to launch the kernel is starting such that the start_kernel() request succeeds, then the process is terminating (probably immediately - although the polling interval of the restarter defaults to 3 seconds). This usually indicates a dependency issue or some runtime anomaly that occurs at startup.

You can try starting the notebook server with the --debug flag, which should produce more output, but I'm not hopeful it will provide helpful information. You really want to see the output of the kernel process. If --debug doesn't help, you might want to try invoking the command specified in the argv stanza of the kernel specification (kernel.json) file. This file can be located by running jupyter kernelspec list and identifying the kernel name corresponding to the kernel you're trying to launch. One of the arguments "parameterized" in the argv stanza will be the location of the connection file, which you may need to fabricate in order to satisfy the command-line invocation. The following may be sufficient - assuming those same ports are available on your system...

{
  "shell_port": 62267,
  "iopub_port": 62268,
  "stdin_port": 62269,
  "control_port": 62271,
  "hb_port": 62270,
  "ip": "127.0.0.1",
  "key": "9e5a53e4-c84a70299f920136ea2434f6",
  "transport": "tcp",
  "signature_scheme": "hmac-sha256",
  "kernel_name": ""
}

This was taken from some remnant files in my Jupyter runtime directory on my system. This directory can be found using jupyter --paths and looking in the runtime directory for files named kernel-UUID.json. Your system might expose different port ranges in case you encounter issues with these values - so you might need to use port numbers closer to those in files in this directory.

@stephencb96
Copy link

stephencb96 commented Oct 17, 2022

thanks, @kevin-bates. Debug output below...as a novice is there anything that sticks out?
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\stephen.bonacci\Desktop\AOTC> conda activate base
PS C:\Users\stephen.bonacci\Desktop\AOTC> & 'C:\ProgramData\Anaconda3\python.exe' 'c:\Users\stephen.bonacci.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '62337' '--' 'c:\Users\stephen.bonacci\Desktop\AOTC\Debug File.ipynb'
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Users\stephen.bonacci.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\python\debugpy\launcher_main
.py", line 91, in
main()
File "c:\Users\stephen.bonacci.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\python\debugpy\launcher_main
.py", line 18, in main
from debugpy.launcher import debuggee
File "c:\Users\stephen.bonacci.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\python\debugpy\launcher/../..\debugpy\launcher\debuggee.py", line 15, in
from debugpy.common import log, messaging
File "c:\Users\stephen.bonacci.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\python\debugpy\launcher/../..\debugpy\common\messaging.py", line 19, in
import socket
File "C:\ProgramData\Anaconda3\lib\socket.py", line 51, in
import _socket
ImportError: WSAStartup failed: error code 10107

@kevin-bates
Copy link
Member

I'm not certain that's the correct command-line invocation (what is 62337?). If that's a port number, you really need to write the entire JSON block I had provided to a file (brackets included), say, connection.json, then reference that file in the command with -f connection.json. That said, I'm not familiar with kernel invocations on Windows.

With that in mind, the issue (above) is due to this: ImportError: WSAStartup failed: error code 10107. Googling that string, I don't find a whole lot, but the most promising is this, indicating it may be due to a firewall. The others talk about having multiple winsock.dll files on the path - but some of those are refuted.

Since you're on Windows I'm not sure how helpful I can be - especially if the manual invocation step is leading you down the wrong path. @vidartf might have seen this before or have a better idea of how to go about a diagnosis or providing "working" instructions for command-line invocation.

@jordan-gilmartin
Copy link

@kevin-bates
Hi Kevin, encountering similar issues as some above. Hoping you may be able to assist. My virtual environment PythonData had been working fine for past couple years but recently went to create a separate new virtual environment for another project, was prompted to make some system updates and download some new packages in that process and since then started to have connectivity issues. Any insight would be greatly appreciated. Let me know if you need any more info, I saved some files with additional console output when I first encountered the issue and was making system updates / downloading new packages.
Regards,
Jordan

Connection Error

Console Output

@kevin-bates
Copy link
Member

Hi @jordan-gilmartin - the console output looks clean. Based on this information, there's either a general connection issue between the browser and notebook server or an issue establishing the websocket connection to the kernel - although I would expect some messaging in the console if the server had been involved.

I recommend restarting your notebook server with --debug to get more information in the console and to check the browser log (although I can't really guide you much on that aspect since that's foreign territory for me but there may be something there others could help with). I don't think the warning message is anything significant right now.

@jordan-gilmartin
Copy link

Thanks @kevin-bates , I went back up through the thread and saw some of your previous comments about using --debug so I went ahead and tried it.

So one of the odd things is that sometimes when I restart my computer it then allows me to connect when I restart the file but it doesn't seem to 100% resolve the issue as I do wind up encountering it again.

Here is the previous file I posted but now having successfully connected without --debug:

Connected

Console Output - Connected

Now with --debug:

Console Output - Connected - Debug 1

Console Output - Connected - Debug 2

Console Output - Connected - Debug 3

Console Output - Connected - Debug 4

Console Output - Connected - Debug 5

Not sure if you can make anything of this, if not I guess I will revert back once I encounter the error again.

Regards,
Jordan

@kevin-bates
Copy link
Member

Hi @jordan-gilmartin. In the first output, the asyncio\events.py stack trace is a little concerning and implies a package version mismatch of sorts. Since these can be timing-related, I suspect that issue is still in play in the --debug version, but you did not encounter it. Perhaps that can explain the intermittency aspect you're experiencing.

The other thing I notice (in both startups) are the in-use ports for 8888 and 8889. Since those are the two preferred ports when the notebook server starts, subsequent startups will move to the next, and is why the output in this last update shows it using port 8890. When troubleshooting, it's a good idea to eliminate as much external "noise" as possible, and, since its possible these other server instances may still be trying to "do their thing", I would recommend using the task manager (I believe that's what it's called on Windows) to terminate the "other" notebook servers running on ports 8888 and 8889, after terminating your current notebook server running on 8890. That is, try to reset the env completely.

I see you're using Notebook 6.1.4, which is probably a bit old. Could you please provide the output (in the same console window you use to start the servers) for jupyter --version? I'm wondering if you're using newer low-level packages with an older server, which may be part of your issue.

Thanks.

@jordan-gilmartin
Copy link

Hi @kevin-bates , please see a few screen shots below with different version info.

I provided base environment versions of conda and jupyter as well as a couple of virtual environments.

Conda I tried to update recently and I thought it took but apparently not since it is still showing a very dated version.

PythonData was my main virtual environment for the past couple years and Alpaca is the one I just created within the past few weeks.

For the jupyter version it appears that the base environment is aligned with the Alpaca virtual environment but the PythonData virtual environment is slightly different in some respects.

Let me know what you think.

Base and PythonData Environments

Alpaca Environment

@kevin-bates
Copy link
Member

These environments are virtually identical with the only real difference being the notebook version - which I don't think is part of the issue. Do you see your issue in the Alpaca or base environments?

Can you provide the versions of tornado and pyzmq in the respective envs?

@jordan-gilmartin
Copy link

I know I have experienced the connection issue in both virtual environments.

I want to say I may have experienced it in the base environment as well but it is very rare that I operate out of the base environment so I'm trying to remember if I may have done it from there within the past few weeks just to troubleshoot.

It looks like pyzmq is version 25.0.0 and tornado is version 6.2 for base and both virtual environments.

@kevin-bates
Copy link
Member

Thanks. Hmm. Running out of ideas. Since both envs exhibit the issue, I'm wondering if you could create yet another env that will install notebook 6.5.2 and assorted other updates, just so you're "current", and see how that behaves. A command along the lines of the following would be sufficient (change notebook-env to whatever name you like):

conda create -n notebook-env notebook

then activate that environment and run jupyter notebook --debug

(Also be sure to shutdown any other active notebook servers. You should see 6.5.2 start on port 8888.)

@jordan-gilmartin
Copy link

No problem Kevin, here you go:

Console Output - testenv 1

Console Output - testenv 2

Console Output - testenv 3

Console Output - testenv 4

@kevin-bates
Copy link
Member

This all looks clean but I don't see any kernel launches. How are things behaving in that respect?

@jordan-gilmartin
Copy link

Just opened that same file, here is output:

Console Output - opening file - testenv 1

Console Output - opening file - testenv 2

Console Output - opening file - testenv 3

Console Output - opening file - testenv 4

Console Output - opening file - testenv 5

Console Output - opening file - testenv 6

@kevin-bates
Copy link
Member

ok - this looks good. Are you seeing an issue?

If not, I suggest you run with this environment for a while and see if things look stable.

@jordan-gilmartin
Copy link

I was able to establish connection to the kernel again using this virtual environment as well so no evidence of the issue currently.

I appreciate your help on this Kevin, if it arises again which I assume it will I will circle back!

Regards,
Jordan

@kevin-bates
Copy link
Member

Thanks for the update @jordan-gilmartin.

Given "Connection Failed" can happen for a myriad of reasons, and there have been multiple troubleshooting successes documented in this one issue, I'm going ahead with the issue's closure. If a new "Connection Failed" issue pops up, I think it's appropriate to create a new issue anyway and, hopefully, we can maintain a "single thread of action" per issue (although that's virtually impossible).

@wail993
Copy link

wail993 commented Mar 26, 2023

for me it was a stupid thing , I closed the terminal that I wrote "jupyter notebook" in it

@ShahidNawaz01
Copy link

I am getting the same error and struggling on it for quite a while now. Can someone please look into it, please?
I have also pasted the jupyter notebook output.

Error:
Connection failed
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.

Jupyter Notebook Output:
(base) C:\Users\shahi>jupyter notebook
[W 02:15:54.378 NotebookApp] Loading JupyterLab as a classic notebook (v6) extension.
[I 2023-06-19 02:15:54.393 LabApp] JupyterLab extension loaded from C:\ProgramData\anaconda3\lib\site-packages\jupyterlab
[I 2023-06-19 02:15:54.393 LabApp] JupyterLab application directory is C:\ProgramData\anaconda3\share\jupyter\lab
[I 02:15:56.356 NotebookApp] Serving notebooks from local directory: C:\Users\shahi
[I 02:15:56.356 NotebookApp] Jupyter Notebook 6.5.2 is running at:
[I 02:15:56.356 NotebookApp] http://localhost:8888/?token=c8df5cac7d73fab8be02b18c4b3afc9b487acea79377bd44
[I 02:15:56.356 NotebookApp] or http://127.0.0.1:8888/?token=c8df5cac7d73fab8be02b18c4b3afc9b487acea79377bd44
[I 02:15:56.356 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 02:15:56.388 NotebookApp]

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

Bad address (C:\ci\zeromq_1616055400030\work\src\epoll.cpp:100)
[I 02:16:02.669 NotebookApp] Kernel started: 33486188-89e9-4457-ad5e-68ba44f28bd0, name: python3
Bad address (C:\ci\zeromq_1616055400030\work\src\epoll.cpp:100)
Bad address (C:\ci\zeromq_1616055400030\work\src\epoll.cpp:100)
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\ProgramData\anaconda3\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\ProgramData\anaconda3\lib\site-packages\ipykernel_launcher.py", line 17, in
app.launch_new_instance()
File "C:\ProgramData\anaconda3\lib\site-packages\traitlets\config\application.py", line 992, in launch_instance
app.start()
File "C:\ProgramData\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 698, in start
self.kernel.start()
File "C:\ProgramData\anaconda3\lib\site-packages\ipykernel\ipkernel.py", line 212, in start
super().start()
File "C:\ProgramData\anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 550, in start
asyncio.run_coroutine_threadsafe(self.poll_control_queue(), control_loop.asyncio_loop)
File "C:\ProgramData\anaconda3\lib\asyncio\tasks.py", line 892, in run_coroutine_threadsafe
loop.call_soon_threadsafe(callback)
File "C:\ProgramData\anaconda3\lib\asyncio\base_events.py", line 798, in call_soon_threadsafe
self._check_closed()
File "C:\ProgramData\anaconda3\lib\asyncio\base_events.py", line 515, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

(base) C:\Users\shahi>[IPKernelApp] WARNING | Parent appears to have exited, shutting down.

@amirakbarnejad
Copy link

In my case conda update --all solved the issue.

@erkdiwakar2021
Copy link

@kevin-bates
I am a new user of Jupyter Notebook. I tried to run Jupyter Notebook, but I faced some errors with the Kernel connection. I have sent you the screenshot of those errors. I am waiting for your response.
Screenshot-1
Screenshot-2
Screenshot-3
Screenshot-4
Screenshot-5
Screenshot-6
Screenshot-7
Screenshot-8
Screenshot-9
Screenshot-10

@SmoltingAmber
Copy link

@kevin-bates
Issue occurred today when I noticed my anaconda navigator exited without me closing it. I was using Jupyter notebook without problem before but when I tried to relaunch it today, I was presented with this error message:

"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."

Trying to launch it from command line resulted in the following log:
[I 10:13:33.456 NotebookApp] Serving notebooks from local directory: C:\Users\arena
[I 10:13:33.456 NotebookApp] Jupyter Notebook 6.5.4 is running at:
[I 10:13:33.456 NotebookApp] http://localhost:8888/?token=c5a68051d3d81fc964448454cd0310f81f5b4366ed6bd5ad
[I 10:13:33.456 NotebookApp] or http://127.0.0.1:8888/?token=c5a68051d3d81fc964448454cd0310f81f5b4366ed6bd5ad
[I 10:13:33.456 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:13:33.476 NotebookApp]

To access the notebook, open this file in a browser:
file:///C:/Users/arena/AppData/Roaming/jupyter/runtime/nbserver-7316-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=c5a68051d3d81fc964448454cd0310f81f5b4366ed6bd5ad
or http://127.0.0.1:8888/?token=c5a68051d3d81fc964448454cd0310f81f5b4366ed6bd5ad
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 10:13:37.684 NotebookApp] Creating new notebook in
Bad address (C:\ci\zeromq_1616055400030\work\src\epoll.cpp:100)
[W 10:13:39.111 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20231030101332 (::1) 20.260000ms referer=http://localhost:8888/notebooks/Untitled11.ipynb?kernel_name=my_env
[I 10:13:39.117 NotebookApp] Kernel started: 38983398-bb22-4527-a438-6703c9caef6e, name: my_env
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.
Bad address (C:\ci\zeromq_1616055400030\work\src\epoll.cpp:100)
Bad address (C:\ci\zeromq_1616055400030\work\src\epoll.cpp:100)
[IPKernelApp] WARNING | Parent appears to have exited, shutting down.

I have searched extensively through stackoverflow and Jupyter notebook stackoverflow threads and tried every suggestion I could found that has worked for someone in both places. I have downgraded tornado, and tried to create a new environment and uninstall then reinstall jupyter notebook, but nothing has worked so far. I have also downloded the newest version of anaconda and python and reinstalled both to no avail.

Hope someone in this community could help me and suggest what I can try next... Thanks in advance!

@kriefj
Copy link

kriefj commented Nov 23, 2023

Hello, I have a similar problem where the kernel is not connecting and each time I try to run a code I get "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 opened jupyter notebook with Anaconda on Mac and then tried to run a python script.
How can I resolve this problem and use jupyter notebook ?

Thanks.

Screenshot 2023-11-23 at 14 07 14

@ShahidNawaz01
Copy link

@kriefj For me, this command 'netsh winsock reset' worked since I was using VPN. You can have a try.

@ivanov
Copy link
Member

ivanov commented Dec 12, 2023

Several people in this thread are @ mentioning Kevin Bates even though when he closed this issue he explicitly stated:

If a new "Connection Failed" issue pops up, I think it's appropriate to create a new issue anyway

so please open a new issue if the solutions provided here are not enough for you.

@jupyter jupyter locked as resolved and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests