Jupyterlab server connection error

Description Reproduce Go to '...' Click on '...' Scroll down to '...' See error '...' Expected behavior Context Operating System and version: Browser and version: Ju...

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


Closed

UNS-AI opened this issue

Feb 19, 2021

· 5 comments

Comments

@UNS-AI

Description

Reproduce

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error ‘…’

Expected behavior

Context

  • Operating System and version:
  • Browser and version:
  • JupyterLab version:

Troubleshoot Output

Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.

Command Line Output

Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.

Browser Output

Paste the output from your browser Javascript console here.

@UNS-AI
UNS-AI

changed the title
Server Connection error

Server Connection error-A connection to the Jupyter server could not be established. Jupyterlab will continue trying to connect. Check your network connection or Jupyter server configuration.

Feb 19, 2021

@jasongrout

@UNS-AI

Hi,
Thank you jasongrout. I am new in Jupyterlab. I encountered this problem when I tried to rename the title of Jupyter notebook, run the cells etc- within any new environments created by me. But works fine within base(root) environment. On checking it is found that the tornado 6.0.4 is in base(root) environment where as tornado 6.1 is in any new environment I create.
Using cmd.exe (with- pip install —upgrade tornado==6.0.4) I have succeeded in changing the version of tornado to 6.0.4- from within a new environment in Anaconda navigator. I confirmed the change to version 6.0.4 by checking the folder — F:/anacond/envs/newenv/lib/site-packages/tornado-6.0.4. But on searching, using search box under environments tab of Navigator, tornado 6.1 shows as before. Also the problem remains same as it was before when running cells, renaming notebook title etc. I repeated the process by creating new environments. Reinstalled Anaconda as a whole. But issue remains as it is.
I tried to proceed with base(root) environment. But it has another issue. It lacks Keras. I tried to import Keras to it and ended up with a long list of errors-conflicts of packages.
OS: Windows 7 ultimate-64 bit
Browser: Firefox 85.0.2
Jupyterlab: 2.2.6

Thank you
AI_screenshots.docx

@UNS-AI

I tested with classic Jupyter Notebook (by accessing from help menu of Jupyter lab). The problem repeats. Please see the screen shots uploaded along with last comment. 1st, 2nd & 4th screen shots -same in Jupyter lab & classic Jupyter Notebook with a new environment created by me. 3rd one is in Jupyter lab with base(root) environment due to the absence of Keras.
Some body please help.

@UNS-AI

Problem solved. I changed my computer. Now working fine. It might be an OS related issue. Previous computer has OS windows 7 ultimate & new one has OS windows 8.
Jasongrouts guidance also helped. Thank you

@jasongrout

Thanks for following up, and I’m glad it’s working now!

@github-actions
github-actions
bot

locked as resolved and limited conversation to collaborators

Aug 26, 2021

2 participants

@jasongrout

@UNS-AI

Содержание

  1. File Save Error and Server Connection Error (NetworkError) occurring on save #4532
  2. Comments
  3. 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. #6261
  4. Comments
  5. 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. #5577
  6. Comments

File Save Error and Server Connection Error (NetworkError) occurring on save #4532

Upon saving notebooks, I have been occasionally receiving three errors in succession upon attempting to save my notebooks:

  1. File Save Error for filename.ipynb: NetworkError when attempting to fetch resource.
  2. Server Connection Error: NetworkError when attempting to fetch resource.
  3. File Save Error for filename.ipynb: NetworkError when attempting to fetch resource.

Below is a screenshot of the JS console in Firefox:

And in Chrome:

I haven’t been able to consistently reproduce these errors.

Interestingly, I get a 403 when attempting to stop my user’s server. I’m not sure if this is related to the main issue — it may just be due to the server host’s config.

I’ve also had the issue occur only on one device, when using one network in particular. Notably, I have been using a VPN on this network, but on other networks and other devices I have not encountered the issue while using the same VPN.

@ellisonbg suggested that it may be due to the browser extensions I have installed (uBlock Origin and various other privacy-related extensions), but I don’t think they are the source of the problem as the issue doesn’t consistently occur and doesn’t occur on other machines using the same browser extensions.

Another thought is that these errors are related to network issues. However, I am able to still interact with notebooks in other ways (edit and run cells, view outputs, restart kernels, etc.) per usual after the errors occur. (I can view output from running cells, but cannot save this output.)

I am currently at a loss for why these errors are occurring. Any help is much appreciated!

The text was updated successfully, but these errors were encountered:

Источник

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. #6261

[I 08:18:54.461 NotebookApp] The port 8888 is already in use, trying another port.
[W 08:18:54.548 NotebookApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File «C:UsersAYOOLAanaconda3libsite-packagesjupyter_serverprometheusmetrics.py», line 12, in
from notebook.prometheus.metrics import HTTP_REQUEST_DURATION_SECONDS, TERMINAL_CURRENTLY_RUNNING_TOTAL, KERNEL_CURRENTLY_RUNNING_TOTAL
ModuleNotFoundError: No module named ‘notebook.prometheus’

[I 08:18:55.084 NotebookApp] Serving notebooks from local directory: C:UsersAYOOLA
[I 08:18:55.084 NotebookApp] The Jupyter Notebook is running at:
[I 08:18:55.085 NotebookApp] http://localhost:8889/?token=23edeb43832f8c4f496974d14f56a20d73a6d39c62eaff45
[I 08:18:55.088 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 08:18:55.169 NotebookApp]

[I 08:18:55.504 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 08:19:01.289 NotebookApp] Creating new notebook in
[I 08:19:07.508 NotebookApp] Kernel s

tarted: 6d7706bb-9c3a-45bb-83fa-818a37558650
C:UsersAYOOLAAppDataRoamingPythonPython39site-packagesnotebookbasezmqhandlers.py:284: RuntimeWarning: coroutine ‘WebSocketHandler.get’ was never awaited
super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
[W 08:19:19.392 NotebookApp] Replacing stale connection: 6d7706bb-9c3a-45bb-83fa-818a37558650:055aec577cea45ff8010a498ac720c18

The text was updated successfully, but these errors were encountered:

You’re running an older (pre 6.0?) version of notebook as is evident by the missing version information in this log statement:

which would explain why the websocket handler was never awaited. It’s also curious to me the mixture of Lab/JupyterServer/Notebook in the logs as well since Lab should be using Jupyter Server completely. As such, I would suggest also updating jupyterlab and jupyter_server versions as well.

Thank you @kevin-bates
I have updated jupyterlab and server, but the error still comes up.

Источник

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. #5577

When I start jupyter notebook I always get this error. Tried uninstalling and installing anaconda twice to resolve it but of no use.
Jupyter notebook version: 6.0.3
Python version: 3.7.6

The text was updated successfully, but these errors were encountered:

Please provide the contents of the console in which you launched your notebook server. It will have details that may shed more light into the issue’s cause.



I am using anaconda prompt to run jupyter notebook, this is what its showing.

It looks like you truncated the primary portion of the traceback (its end). Please (PLEASE) do not use screenshots to provide this information, but instead, ‘select’/’copy’ then ‘paste’. This allows others to «grab» specific text — which better facilitates the ability to troubleshoot.

Since the information is incomplete I can only surmise. This «smells» like an import conflict with local files/directories in your notebook-dir, but, again, don’t really have enough information to go here. If you have python files that might resemble package names found in import statements, I would suggest perhaps renaming those. One such example might be an application.py file — since that’s the last import statement I see.

(base) C:UsersAcer>jupyter notebook
[I 21:57:22.191 NotebookApp] JupyterLab extension loaded from C:UsersAceranaconda3libsite-packagesjupyterlab
[I 21:57:22.192 NotebookApp] JupyterLab application directory is C:UsersAceranaconda3sharejupyterlab
[I 21:57:22.210 NotebookApp] Serving notebooks from local directory: C:UsersAcer
[I 21:57:22.210 NotebookApp] The Jupyter Notebook is running at:
[I 21:57:22.210 NotebookApp] http://localhost:8888/?token=894e685b59803fc745e0f52258ede5989e106345e07c9fca
[I 21:57:22.210 NotebookApp] or http://127.0.0.1:8888/?token=894e685b59803fc745e0f52258ede5989e106345e07c9fca
[I 21:57:22.210 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:57:22.255 NotebookApp]

[I 21:57:30.507 NotebookApp] Kernel started: 9f1fca9d-ad2e-4231-88c9-422194adf48c
Traceback (most recent call last):
File «C:UsersAceranaconda3librunpy.py», line 193, in run_module_as_main
«main«, mod_spec)
File «C:UsersAceranaconda3librunpy.py», line 85, in run_code
exec(code, run_globals)
File «C:UsersAceranaconda3libsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UsersAceranaconda3libsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UsersAceranaconda3libsite-packagesipykernelconnect.py», line 13, in
from IPython.core.profiledir import ProfileDir
File «C:UsersAceranaconda3libsite-packagesIPython_init
.py», line 55, in
from .core.application import Application
File «C:UsersAceranaconda3libsite-packagesIPythoncoreapplication.py», line 23, in
from traitlets.config.application import Application, catch_config_error
File «C:UsersAceranaconda3libsite-packagestraitletsconfig_init_.py», line 6, in
from .application import *
File «C:UsersAceranaconda3libsite-packagestraitletsconfigapplication.py», line 19, in
from traitlets.config.configurable import Configurable, SingletonConfigurable
File «C:UsersAceranaconda3libsite-packagestraitletsconfigconfigurable.py», line 12, in
from .loader import Config, LazyConfigValue, is_section_key
File «C:UsersAceranaconda3libsite-packagestraitletsconfigloader.py», line 16, in
from ipython_genutils.path import filefind
File «C:UsersAceranaconda3libsite-packagesipython_genutilspath.py», line 13, in
import random
File «C:UsersAcerDesktopNotebooksrandom.py», line 4, in
rand_set = random.sample(english_words_lower_set, 12)
AttributeError: module ‘random’ has no attribute ‘sample’
[I 21:57:33.484 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File «C:UsersAceranaconda3librunpy.py», line 193, in run_module_as_main
«main«, mod_spec)
File «C:UsersAceranaconda3librunpy.py», line 85, in run_code
exec(code, run_globals)
File «C:UsersAceranaconda3libsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UsersAceranaconda3libsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UsersAceranaconda3libsite-packagesipykernelconnect.py», line 13, in
from IPython.core.profiledir import ProfileDir
File «C:UsersAceranaconda3libsite-packagesIPython_init
.py», line 55, in
from .core.application import Application
File «C:UsersAceranaconda3libsite-packagesIPythoncoreapplication.py», line 23, in
from traitlets.config.application import Application, catch_config_error
File «C:UsersAceranaconda3libsite-packagestraitletsconfig_init.py», line 6, in
from .application import *
File «C:UsersAceranaconda3libsite-packagestraitletsconfigapplication.py», line 19, in
from traitlets.config.configurable import Configurable, SingletonConfigurable
File «C:UsersAceranaconda3libsite-packagestraitletsconfigconfigurable.py», line 12, in
from .loader import Config, LazyConfigValue, is_section_key
File «C:UsersAceranaconda3libsite-packagestraitletsconfigloader.py», line 16, in
from ipython_genutils.path import filefind
File «C:UsersAceranaconda3libsite-packagesipython_genutilspath.py», line 13, in
import random
File «C:UsersAcerDesktopNotebooksrandom.py», line 4, in
rand_set = random.sample(english_words_lower_set, 12)
AttributeError: module ‘random’ has no attribute ‘sample’
[I 21:57:36.495 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
File «C:UsersAceranaconda3librunpy.py», line 193, in run_module_as_main
«main«, mod_spec)
File «C:UsersAceranaconda3librunpy.py», line 85, in run_code
exec(code, run_globals)
File «C:UsersAceranaconda3libsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UsersAceranaconda3libsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UsersAceranaconda3libsite-packagesipykernelconnect.py», line 13, in
from IPython.core.profiledir import ProfileDir
File «C:UsersAceranaconda3libsite-packagesIPython_init
.py», line 55, in
from .core.application import Application
File «C:UsersAceranaconda3libsite-packagesIPythoncoreapplication.py», line 23, in
from traitlets.config.application import Application, catch_config_error
File «C:UsersAceranaconda3libsite-packagestraitletsconfig_init.py», line 6, in
from .application import *
File «C:UsersAceranaconda3libsite-packagestraitletsconfigapplication.py», line 19, in
from traitlets.config.configurable import Configurable, SingletonConfigurable
File «C:UsersAceranaconda3libsite-packagestraitletsconfigconfigurable.py», line 12, in
from .loader import Config, LazyConfigValue, is_section_key
File «C:UsersAceranaconda3libsite-packagestraitletsconfigloader.py», line 16, in
from ipython_genutils.path import filefind
File «C:UsersAceranaconda3libsite-packagesipython_genutilspath.py», line 13, in
import random
File «C:UsersAcerDesktopNotebooksrandom.py», line 4, in
rand_set = random.sample(english_words_lower_set, 12)
AttributeError: module ‘random’ has no attribute ‘sample’
[I 21:57:39.524 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
File «C:UsersAceranaconda3librunpy.py», line 193, in run_module_as_main
«main«, mod_spec)
File «C:UsersAceranaconda3librunpy.py», line 85, in run_code
exec(code, run_globals)
File «C:UsersAceranaconda3libsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UsersAceranaconda3libsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UsersAceranaconda3libsite-packagesipykernelconnect.py», line 13, in
from IPython.core.profiledir import ProfileDir
File «C:UsersAceranaconda3libsite-packagesIPython_init
.py», line 55, in
from .core.application import Application
File «C:UsersAceranaconda3libsite-packagesIPythoncoreapplication.py», line 23, in
from traitlets.config.application import Application, catch_config_error
File «C:UsersAceranaconda3libsite-packagestraitletsconfig_init.py», line 6, in
from .application import *
File «C:UsersAceranaconda3libsite-packagestraitletsconfigapplication.py», line 19, in
from traitlets.config.configurable import Configurable, SingletonConfigurable
File «C:UsersAceranaconda3libsite-packagestraitletsconfigconfigurable.py», line 12, in
from .loader import Config, LazyConfigValue, is_section_key
File «C:UsersAceranaconda3libsite-packagestraitletsconfigloader.py», line 16, in
from ipython_genutils.path import filefind
File «C:UsersAceranaconda3libsite-packagesipython_genutilspath.py», line 13, in
import random
File «C:UsersAcerDesktopNotebooksrandom.py», line 4, in
rand_set = random.sample(english_words_lower_set, 12)
AttributeError: module ‘random’ has no attribute ‘sample’
[I 21:57:42.541 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File «C:UsersAceranaconda3librunpy.py», line 193, in run_module_as_main
«main«, mod_spec)
File «C:UsersAceranaconda3librunpy.py», line 85, in run_code
exec(code, run_globals)
File «C:UsersAceranaconda3libsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UsersAceranaconda3libsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UsersAceranaconda3libsite-packagesipykernelconnect.py», line 13, in
from IPython.core.profiledir import ProfileDir
File «C:UsersAceranaconda3libsite-packagesIPython_init
.py», line 55, in
from .core.application import Application
File «C:UsersAceranaconda3libsite-packagesIPythoncoreapplication.py», line 23, in
from traitlets.config.application import Application, catch_config_error
File «C:UsersAceranaconda3libsite-packagestraitletsconfig_init.py», line 6, in
from .application import *
File «C:UsersAceranaconda3libsite-packagestraitletsconfigapplication.py», line 19, in
from traitlets.config.configurable import Configurable, SingletonConfigurable
File «C:UsersAceranaconda3libsite-packagestraitletsconfigconfigurable.py», line 12, in
from .loader import Config, LazyConfigValue, _is_section_key
File «C:UsersAceranaconda3libsite-packagestraitletsconfigloader.py», line 16, in
from ipython_genutils.path import filefind
File «C:UsersAceranaconda3libsite-packagesipython_genutilspath.py», line 13, in
import random
File «C:UsersAcerDesktopNotebooksrandom.py», line 4, in
rand_set = random.sample(english_words_lower_set, 12)
AttributeError: module ‘random’ has no attribute ‘sample’
[W 21:57:45.548 NotebookApp] KernelRestarter: restart failed
[W 21:57:45.549 NotebookApp] Kernel 9f1fca9d-ad2e-4231-88c9-422194adf48c died, removing from map.
[W 21:58:30.553 NotebookApp] Timeout waiting for kernel_info reply from 9f1fca9d-ad2e-4231-88c9-422194adf48c
[E 21:58:30.557 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 9f1fca9d-ad2e-4231-88c9-422194adf48c)
[W 21:58:32.097 NotebookApp] 404 GET /api/kernels/9f1fca9d-ad2e-4231-88c9-422194adf48c/channels?session_id=f495078dc6ee4f488e0f5527bc081077 (::1): Kernel does not exist: 9f1fca9d-ad2e-4231-88c9-422194adf48c
[W 21:58:32.118 NotebookApp] 404 GET /api/kernels/9f1fca9d-ad2e-4231-88c9-422194adf48c/channels?session_id=f495078dc6ee4f488e0f5527bc081077 (::1) 25.93ms referer=None
[W 21:58:35.088 NotebookApp] Replacing stale connection: 9f1fca9d-ad2e-4231-88c9-422194adf48c:f495078dc6ee4f488e0f5527bc081077

Thanks for the update. This includes much more detail and my hunch looks correct — your local random.py is in conflict with Python’s random module:

File «C:UsersAceranaconda3libsite-packagesipython_genutilspath.py», line 13, in
import random
File «C:UsersAcerDesktopNotebooksrandom.py», line 4, in
rand_set = random.sample(english_words_lower_set, 12)
AttributeError: module ‘random’ has no attribute ‘sample’

Rename C:UsersAcerDesktopNotebooksrandom.py (and address the side-effects that produces) and you should be moving forward.

If this helps anyone at times this could be a browser issue — I ran into this when using safari. Switched to Firefox and it worked fine there.

Hi, I also have a similar issue..can anyone help me out. Jupyter Notebook on Anaconda. I uninstalled and reinstalled Jupyter notebook, but the issue was not solved. It was working before but now it isn’t. Please help

[I 14:45:43.689 NotebookApp] Serving notebooks from local directory: C:Userssukle
[I 14:45:43.689 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 14:45:43.693 NotebookApp] http://localhost:8888/?token=b16271feaf5c0c93ee17cf6b98e081d781b1a4be270d73de
[I 14:45:43.693 NotebookApp] or http://127.0.0.1:8888/?token=b16271feaf5c0c93ee17cf6b98e081d781b1a4be270d73de
[I 14:45:43.693 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:45:43.789 NotebookApp]

[W 14:45:58.772 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20210219144543 (127.0.0.1) 15.140000ms referer=http://localhost:8888/notebooks/opencv.ipynb
[I 14:45:59.193 NotebookApp] Kernel started: 2626c9a0-f3fb-4424-af05-09d19bcefac7, name: python3
Traceback (most recent call last):
File «C:anaconda3librunpy.py», line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File «C:anaconda3librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernelconnect.py», line 11, in
from IPython.core.profiledir import ProfileDir
File «C:anaconda3libsite-packagesIPython_init
.py», line 56, in
from .terminal.embed import embed
File «C:anaconda3libsite-packagesIPythonterminalembed.py», line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File «C:anaconda3libsite-packagesIPythonterminalinteractiveshell.py», line 21, in
from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named ‘prompt_toolkit.formatted_text’
[I 14:46:02.133 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File «C:anaconda3librunpy.py», line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File «C:anaconda3librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernelconnect.py», line 11, in
from IPython.core.profiledir import ProfileDir
File «C:anaconda3libsite-packagesIPython_init
.py», line 56, in
from .terminal.embed import embed
File «C:anaconda3libsite-packagesIPythonterminalembed.py», line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File «C:anaconda3libsite-packagesIPythonterminalinteractiveshell.py», line 21, in
from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named ‘prompt_toolkit.formatted_text’
[I 14:46:05.144 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
File «C:anaconda3librunpy.py», line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File «C:anaconda3librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernelconnect.py», line 11, in
from IPython.core.profiledir import ProfileDir
File «C:anaconda3libsite-packagesIPython_init
.py», line 56, in
from .terminal.embed import embed
File «C:anaconda3libsite-packagesIPythonterminalembed.py», line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File «C:anaconda3libsite-packagesIPythonterminalinteractiveshell.py», line 21, in
from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named ‘prompt_toolkit.formatted_text’
[I 14:46:08.154 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
File «C:anaconda3librunpy.py», line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File «C:anaconda3librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernelconnect.py», line 11, in
from IPython.core.profiledir import ProfileDir
File «C:anaconda3libsite-packagesIPython_init
.py», line 56, in
from .terminal.embed import embed
File «C:anaconda3libsite-packagesIPythonterminalembed.py», line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File «C:anaconda3libsite-packagesIPythonterminalinteractiveshell.py», line 21, in
from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named ‘prompt_toolkit.formatted_text’
[I 14:46:11.161 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File «C:anaconda3librunpy.py», line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File «C:anaconda3librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:UserssukleAppDataRoamingPythonPython38site-packagesipykernelconnect.py», line 11, in
from IPython.core.profiledir import ProfileDir
File «C:anaconda3libsite-packagesIPython_init
.py», line 56, in
from .terminal.embed import embed
File «C:anaconda3libsite-packagesIPythonterminalembed.py», line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File «C:anaconda3libsite-packagesIPythonterminalinteractiveshell.py», line 21, in
from prompt_toolkit.formatted_text import PygmentsTokens
ModuleNotFoundError: No module named ‘prompt_toolkit.formatted_text’
[W 14:46:14.179 NotebookApp] KernelRestarter: restart failed
[W 14:46:20.618 NotebookApp] Kernel 2626c9a0-f3fb-4424-af05-09d19bcefac7 died, removing from map.
[W 14:46:20.620 NotebookApp] Replacing stale connection: 2626c9a0-f3fb-4424-af05-09d19bcefac7:8572e89ed13b45e684bba39942daf0fc
[W 14:46:43.206 NotebookApp] Replacing stale connection: 2626c9a0-f3fb-4424-af05-09d19bcefac7:8572e89ed13b45e684bba39942daf0fc

It looks like this issue is due to an older prompt_toolkit used by IPython . Try upgrading prompt_toolkit to its 3.0.2 or 3.0.3 releases. Since this is coming from the kernel, and if you’re using multiple environments, it’s important that the proper python command be invoked for the upgrade. To determine which python command to use,

  • locate the kernel’s kernel specification directory using: jupyter kernelspec list
  • open the matching directory’s kernel.json file
  • use the python identified in the argv stanza in the following command.

python -m pip install —upgrade prompt_toolkit

where python is the python identified in the kernel.json file.

You should not need to restart your notebook server, just restart the kernel.

Thanks a lot for the help. It’s working again 😁

Have a similar problem but not sure what to do here. Can you help?
Thanks,

C:Usersjm273PycharmProjectspythonProjectvenvScripts>jupyter notebook
[I 2021-02-22 14:01:31.185 LabApp] JupyterLab extension loaded from c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesjupyterlab
[I 2021-02-22 14:01:31.185 LabApp] JupyterLab application directory is C:Usersjm273PycharmProjectspythonProjectvenvsharejupyterlab
[I 14:01:31.194 NotebookApp] Serving notebooks from local directory: C:Usersjm273PycharmProjectspythonProjectvenvScripts
[I 14:01:31.195 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 14:01:31.195 NotebookApp] http://localhost:8888/?token=1cf723ee9fccea0335b8c3c15a825c15f6cecb20f26159ce
[I 14:01:31.196 NotebookApp] or http://127.0.0.1:8888/?token=1cf723ee9fccea0335b8c3c15a825c15f6cecb20f26159ce
[I 14:01:31.196 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:01:31.538 NotebookApp]

[W 14:02:49.231 NotebookApp] Notebook QC_Replacement_prod_3.6 (with ML)- with pickle load only.ipynb is not trusted
[I 14:02:57.444 NotebookApp] Kernel started: dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29, name: python3
[IPKernelApp] WARNING | Could not set permissions on F:.ipythonprofile_defaultpid
Traceback (most recent call last):
File «C:Usersjm273PythonPython37librunpy.py», line 193, in _run_module_as_main
«main«, mod_spec)
File «C:Usersjm273PythonPython37librunpy.py», line 85, in _run_code
exec(code, run_globals)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesipykernel_launcher.py», line 16, in
app.launch_new_instance()
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletsconfigapplication.py», line 844, in launch_instance
app.initialize(argv)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletsconfigapplication.py», line 87, in inner
return method(app, *args, **kwargs)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesipykernelkernelapp.py», line 559, in initialize
super(IPKernelApp, self).initialize(argv)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletsconfigapplication.py», line 87, in inner
return method(app, *args, **kwargs)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreapplication.py», line 458, in initialize
self.init_profile_dir()
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreapplication.py», line 362, in init_profile_dir
p = ProfileDir.find_profile_dir_by_name(self.ipython_dir, self.profile, self.config)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreprofiledir.py», line 205, in find_profile_dir_by_name
return cls(location=profile_dir, config=config)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletsconfigconfigurable.py», line 82, in init
super(Configurable, self).init(**kwargs)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletstraitlets.py», line 1080, in init
super_kwargs[key] = value
File «C:Usersjm273PythonPython37libcontextlib.py», line 119, in exit
next(self.gen)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletstraitlets.py», line 1214, in hold_trait_notifications
self.notify_change(change)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletstraitlets.py», line 1227, in notify_change
return self._notify_observers(change)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagestraitletstraitlets.py», line 1264, in _notify_observers
c(event)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreprofiledir.py», line 69, in _location_changed
self.check_dirs()
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreprofiledir.py», line 134, in check_dirs
self.check_startup_dir()
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreprofiledir.py», line 111, in check_startup_dir
self._mkdir(self.startup_dir)
File «c:usersjm273pycharmprojectspythonprojectvenvlibsite-packagesIPythoncoreprofiledir.py», line 96, in _mkdir
os.mkdir(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘F:.ipythonprofile_defaultstartup’
[I 14:03:15.424 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
[IPKernelApp] ERROR | couldn’t create path F:.ipythonextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonextensions’
[IPKernelApp] ERROR | couldn’t create path F:.ipythonnbextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonnbextensions’
[IPKernelApp] CRITICAL | Could not create profile: ‘default’
[I 14:03:18.480 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports
[IPKernelApp] ERROR | couldn’t create path F:.ipythonextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonextensions’
[IPKernelApp] ERROR | couldn’t create path F:.ipythonnbextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonnbextensions’
[IPKernelApp] CRITICAL | Could not create profile: ‘default’
[I 14:03:30.839 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
[IPKernelApp] ERROR | couldn’t create path F:.ipythonextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonextensions’
[IPKernelApp] ERROR | couldn’t create path F:.ipythonnbextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonnbextensions’
[IPKernelApp] CRITICAL | Could not create profile: ‘default’
[I 14:03:33.897 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports
[IPKernelApp] ERROR | couldn’t create path F:.ipythonextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonextensions’
[IPKernelApp] ERROR | couldn’t create path F:.ipythonnbextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonnbextensions’
[IPKernelApp] CRITICAL | Could not create profile: ‘default’
[I 14:03:36.975 NotebookApp] KernelRestarter: restarting kernel (3/5), keep random ports
[IPKernelApp] ERROR | couldn’t create path F:.ipythonextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonextensions’
[IPKernelApp] ERROR | couldn’t create path F:.ipythonnbextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonnbextensions’
[IPKernelApp] CRITICAL | Could not create profile: ‘default’
[I 14:03:40.057 NotebookApp] KernelRestarter: restarting kernel (4/5), keep random ports
[IPKernelApp] ERROR | couldn’t create path F:.ipythonextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonextensions’
[IPKernelApp] ERROR | couldn’t create path F:.ipythonnbextensions: [WinError 1251] This operation is supported only when you are connected to the server: ‘F:.ipythonnbextensions’
[IPKernelApp] CRITICAL | Could not create profile: ‘default’
[W 14:03:43.117 NotebookApp] KernelRestarter: restart failed
[W 14:03:43.117 NotebookApp] Kernel dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29 died, removing from map.
[W 14:03:57.556 NotebookApp] Timeout waiting for kernel_info reply from dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29
[E 14:03:57.559 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29)
[W 14:03:58.609 NotebookApp] 404 GET /api/kernels/dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29/channels?session_id=ef4be499bd77499b891f5656565880f4 (::1): Kernel does not exist: dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29
[W 14:03:58.653 NotebookApp] 404 GET /api/kernels/dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29/channels?session_id=ef4be499bd77499b891f5656565880f4 (::1) 46.910000ms referer=None
[W 14:04:00.706 NotebookApp] Replacing stale connection: dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29:ef4be499bd77499b891f5656565880f4
[W 14:08:04.977 NotebookApp] Replacing stale connection: dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29:ef4be499bd77499b891f5656565880f4
[W 14:12:13.007 NotebookApp] Replacing stale connection: dfac873f-21d9-4fae-a0c9-6ad3c4e2ac29:ef4be499bd77499b891f5656565880f4

Hi @jackmurak — your issue looks specific to IPython configuration and the fact that you happen to be spanning Windows drive (C and F). Unfortunately, I’m not familiar very familiar with either, although I do know that there’s a history of frustration with content management’s confinement to a particular drive.

Do these folders exist on your system?
F:.ipythonprofile_defaultstartup ,
F:.ipythonextensions ,
F:.ipythonnbextensions

Do similar folders exist in $HOME and is $HOME pointing to a different drive?

What output do you get from jupyter kernelspec list ?

For the kernel you’re trying to use, is its kernelspec folder (i.e., the folder listed in the command’s output) on your C drive, but the contents of that folder’s kernel.json point to F?

What output do you get from jupyter —paths —debug ?

Perhaps some of this will shed some light for both of us.

Do these folders exist on your system?
F:.ipythonprofile_defaultstartup,
F:.ipythonextensions,
F:.ipythonnbextensions

Yes. I’m not sure why, I thought I installed everything to C: ?

Do similar folders exist in $HOME and is $HOME pointing to a different drive?

Not sure how to do this? I’m not using anaconda.

What output do you get from jupyter kernelspec list?

C:Usersjm273PycharmProjectspythonProjectvenvScripts>jupyter kernel spec list
[KernelApp] Starting kernel ‘python3’
[KernelApp] Connection file: C:Usersjm273AppDataRoamingjupyterruntimekernel-08d7fe83-7b3a-4959-936b-9310815cb6a9.json
[KernelApp] To connect a client: —existing kernel-08d7fe83-7b3a-4959-936b-9310815cb6a9.json

For the kernel you’re trying to use, is its kernelspec folder (i.e., the folder listed in the command’s output) on your C drive, but the contents of that folder’s kernel.json point to F?

What output do you get from jupyter —paths —debug?
C:Usersjm273PycharmProjectspythonProjectvenvScripts>jupyter —paths —debug
JUPYTER_PREFER_ENV_PATH is not set, making the user-level path preferred over the environment-level path for data and config
JUPYTER_NO_CONFIG is not set, so we use the full path list for config
JUPYTER_CONFIG_PATH is not set, so we do not prepend anything to the config paths
JUPYTER_CONFIG_DIR is not set, so we use the default user-level config directory
JUPYTER_PATH is not set, so we do not prepend anything to the data paths
JUPYTER_DATA_DIR is not set, so we use the default user-level data directory
JUPYTER_RUNTIME_DIR is not set, so we use the default runtime directory

config:
F:.jupyter
c:usersjm273pycharmprojectspythonprojectvenvetcjupyter
C:ProgramDatajupyter
data:
C:Usersjm273AppDataRoamingjupyter
c:usersjm273pycharmprojectspythonprojectvenvsharejupyter
C:ProgramDatajupyter
runtime:
C:Usersjm273AppDataRoamingjupyterruntime

Is there a way to point everything at my C: ?

$HOME is an environment variable indicating where your user’s «default» directory resides. On Windows systems, all environment variables can be viewed from the CMD prompt using set . You can display individual values using echo %VARIABLE_NAME% . I suspect the value of your HOME variable is set to F: for whatever reason.

What is the output of echo %HOME% ?

Since it sounds like you weren’t aware of anything on your F drive and given the other path values, you might try unsettling your HOME env entirely, or set it to C:Usersjm273 since I suspect that is your user’s «default» directory. (That is, when you log into your system, are you placed into directory C:Usersjm273 ?)

I think once jupyter —paths stops displaying stuff from F: , you’ll be good to go.

Another thing to check is where python.exe is coming from. I believe the Windows command for this is where python.exe . If it’s pointing to F: , then you might look into installing python in your C: drive.

What is the value of echo %PATH% ? Your PATH may be configured to prefer items in F: over C: and that may need to be adjusted.

I apologize for the number of questions here. I’m not sure at which level to approach things.

Since it sounds like you weren’t aware of anything on your F drive and given the other path values, you might try unsettling your HOME env entirely, or set it to C:Usersjm273 since I suspect that is your user’s «default» directory. (That is, when you log into your system, are you placed into directory C:Usersjm273?)

How do I do this?

where python.exe
C:Usersjm273PycharmProjectspythonProjectvenvScriptspython.exe

What is the value of echo %PATH%? Your PATH may be configured to prefer items in F: over C: and that may need to be adjusted.
C:>echo %PATH%
C:IBMv117 InformationServer/jdk32jrebin;C:IBMv117 InformationServer/jdk32jrebinj9vm;C:IBMv117 InformationServerASBNodelibcpp;C:IBMv117 InformationServerASBNodeappsproxycppvc60MT_dllbin;C:Program Files (x86)MKS Toolkitmksnt;C:PROGRA 2MKSTOO 1bin64;C:PROGRA 2MKSTOO 1bin;C:PROGRA 2MKSTOO 1binX11;C:PROGRA 2MKSTOO 1mksnt;C:IBMv115SP6InformationServer/jdk32jrebin;C:IBMv115SP6InformationServer/jdk32jrebinj9vm;C:IBMv115SP6InformationServerASBNodelibcpp;C:IBMv115SP6InformationServerASBNodeappsproxycppvc60MT_dllbin;c:oracleproduct12.1.0client_1bin;C:Program Files (x86)Common FilesOracleJavajavapath;C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)WebexWebexApplications;C:Program Files (x86)Pulse SecureVC142.CRTX64;C:Program Files (x86)Pulse SecureVC142.CRTX86;C:Program Files (x86)SymantecVIP Access Client;C:SQLDLL;C:SQLBIN;C:SQL_12_5OCS-12_5dll;C:SQL_12_5OCS-12_5lib3p;C:SQL_12_5OCS-12_5BIN;C:DB2SQLLIBBIN;C:DB2SQLLIBFUNCTION;C:DB2SQLLIBSAMPLESREPL;C:Usersjm273AppDataLocalMicrosoftWindowsApps;;C:Usersjm273AppDataLocalJetBrainsPyCharm Community Edition 2020.3.3bin;

thanks for all your help. looks like i need to remove F: from a file somewhere?

Thanks for the information Jack. Yeah, I suspect you should remove or update the value of your HOME environment variable.

Managing environment variables on Windows is a bit different (than Unix systems) but easily found via an internet search. Here’s one such link: https://www.wikihow.com/Create-an-Environment-Variable-in-Windows-10

If you’re going to set it (versus remove it), I would set it to C:Usersjm273 since I suspect that’s the desired value. Also, remember to terminate any existing command windows after setting the new value since those settings only take effect on new window instances.

Got it. Thanks so much Kevin for your help!

How can I repay?

Right on — glad you’re moving forward!

anyone know anything about installing ibm_db ? that’s my next hurdle 🙂

For general, Jupyter-related, topics, you’ll be better off posting to the discourse forums: https://discourse.jupyter.org/. However, if you’re talking about installing ibm_db in general, that is external to Jupyter and the product’s website/documentation should be consulted. Once the issue can be linked to Jupyter, we’ll be happy to help. Good luck.

hi, @kevin-bates I’m facing the same problem, can you help, please.

[I 11:11:25.239 NotebookApp] JupyterLab extension loaded from C:AnacondaLibsite-packagesjupyterlab
[I 11:11:25.239 NotebookApp] JupyterLab application directory is C:Anacondasharejupyterlab
[I 11:11:25.975 NotebookApp] Serving notebooks from local directory: C:Usersuser
[I 11:11:25.975 NotebookApp] The Jupyter Notebook is running at:
[I 11:11:25.975 NotebookApp] http://localhost:8888/?token=e048d2b1d4a5f1c88c60cf8d25a54962e21ff3c6b142837a
[I 11:11:25.976 NotebookApp] or http://127.0.0.1:8888/?token=e048d2b1d4a5f1c88c60cf8d25a54962e21ff3c6b142837a
[I 11:11:25.976 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:11:26.230 NotebookApp]

[I 11:11:50.118 NotebookApp] Kernel started: af549d07-bd5d-4674-aad0-d0504f9d3a00
Traceback (most recent call last):
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 197, in run_module_as_main
return run_code(code, main_globals, None,
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:AnacondaLibsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:AnacondaLibsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:AnacondaLibsite-packagesipykernelconnect.py», line 18, in
import jupyter_client
File «C:AnacondaLibsite-packagesjupyter_client_init
.py», line 4, in
from .connect import *
File «C:AnacondaLibsite-packagesjupyter_clientconnect.py», line 24, in
import zmq
File «C:AnacondaLibsite-packageszmq_init.py», line 47, in
from zmq import backend
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 40, in
reraise(*exc_info)
File «C:AnacondaLibsite-packageszmqutilssixcerpt.py», line 34, in reraise
raise value
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 27, in
ns = select_backend(first)
File «C:AnacondaLibsite-packageszmqbackendselect.py», line 28, in select_backend
mod = import(name, fromlist=public_api)
File «C:AnacondaLibsite-packageszmqbackendcython_init
.py», line 6, in
from . import (constants, error, message, context,
ImportError: cannot import name ‘constants’ from partially initialized module ‘zmq.backend.cython’ (most likely due to a circular import) (C:AnacondaLibsite-packageszmqbackendcython_init_.py)
[I 11:11:53.103 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 197, in run_module_as_main
return run_code(code, main_globals, None,
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:AnacondaLibsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:AnacondaLibsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:AnacondaLibsite-packagesipykernelconnect.py», line 18, in
import jupyter_client
File «C:AnacondaLibsite-packagesjupyter_client_init
.py», line 4, in
from .connect import *
File «C:AnacondaLibsite-packagesjupyter_clientconnect.py», line 24, in
import zmq
File «C:AnacondaLibsite-packageszmq_init.py», line 47, in
from zmq import backend
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 40, in
reraise(*exc_info)
File «C:AnacondaLibsite-packageszmqutilssixcerpt.py», line 34, in reraise
raise value
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 27, in
ns = select_backend(first)
File «C:AnacondaLibsite-packageszmqbackendselect.py», line 28, in select_backend
mod = import(name, fromlist=public_api)
File «C:AnacondaLibsite-packageszmqbackendcython_init
.py», line 6, in
from . import (constants, error, message, context,
ImportError: cannot import name ‘constants’ from partially initialized module ‘zmq.backend.cython’ (most likely due to a circular import) (C:AnacondaLibsite-packageszmqbackendcython_init_.py)
[I 11:11:56.135 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 197, in run_module_as_main
return run_code(code, main_globals, None,
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:AnacondaLibsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:AnacondaLibsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:AnacondaLibsite-packagesipykernelconnect.py», line 18, in
import jupyter_client
File «C:AnacondaLibsite-packagesjupyter_client_init
.py», line 4, in
from .connect import *
File «C:AnacondaLibsite-packagesjupyter_clientconnect.py», line 24, in
import zmq
File «C:AnacondaLibsite-packageszmq_init.py», line 47, in
from zmq import backend
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 40, in
reraise(*exc_info)
File «C:AnacondaLibsite-packageszmqutilssixcerpt.py», line 34, in reraise
raise value
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 27, in
ns = select_backend(first)
File «C:AnacondaLibsite-packageszmqbackendselect.py», line 28, in select_backend
mod = import(name, fromlist=public_api)
File «C:AnacondaLibsite-packageszmqbackendcython_init
.py», line 6, in
from . import (constants, error, message, context,
ImportError: cannot import name ‘constants’ from partially initialized module ‘zmq.backend.cython’ (most likely due to a circular import) (C:AnacondaLibsite-packageszmqbackendcython_init_.py)
[I 11:11:59.169 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 197, in run_module_as_main
return run_code(code, main_globals, None,
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:AnacondaLibsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:AnacondaLibsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:AnacondaLibsite-packagesipykernelconnect.py», line 18, in
import jupyter_client
File «C:AnacondaLibsite-packagesjupyter_client_init
.py», line 4, in
from .connect import *
File «C:AnacondaLibsite-packagesjupyter_clientconnect.py», line 24, in
import zmq
File «C:AnacondaLibsite-packageszmq_init.py», line 47, in
from zmq import backend
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 40, in
reraise(*exc_info)
File «C:AnacondaLibsite-packageszmqutilssixcerpt.py», line 34, in reraise
raise value
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 27, in
ns = select_backend(first)
File «C:AnacondaLibsite-packageszmqbackendselect.py», line 28, in select_backend
mod = import(name, fromlist=public_api)
File «C:AnacondaLibsite-packageszmqbackendcython_init
.py», line 6, in
from . import (constants, error, message, context,
ImportError: cannot import name ‘constants’ from partially initialized module ‘zmq.backend.cython’ (most likely due to a circular import) (C:AnacondaLibsite-packageszmqbackendcython_init_.py)
[I 11:12:02.214 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 197, in run_module_as_main
return run_code(code, main_globals, None,
File «C:UsersuserAppDataLocalProgramsPythonPython39librunpy.py», line 87, in run_code
exec(code, run_globals)
File «C:AnacondaLibsite-packagesipykernel_launcher.py», line 15, in
from ipykernel import kernelapp as app
File «C:AnacondaLibsite-packagesipykernel_init
.py», line 2, in
from .connect import *
File «C:AnacondaLibsite-packagesipykernelconnect.py», line 18, in
import jupyter_client
File «C:AnacondaLibsite-packagesjupyter_client_init
.py», line 4, in
from .connect import *
File «C:AnacondaLibsite-packagesjupyter_clientconnect.py», line 24, in
import zmq
File «C:AnacondaLibsite-packageszmq_init.py», line 47, in
from zmq import backend
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 40, in
reraise(*exc_info)
File «C:AnacondaLibsite-packageszmqutilssixcerpt.py», line 34, in reraise
raise value
File «C:AnacondaLibsite-packageszmqbackend_init_.py», line 27, in
ns = select_backend(first)
File «C:AnacondaLibsite-packageszmqbackendselect.py», line 28, in select_backend
mod = import(name, fromlist=public_api)
File «C:AnacondaLibsite-packageszmqbackendcython_init
.py», line 6, in
from . import (constants, error, message, context,
ImportError: cannot import name ‘constants’ from partially initialized module ‘zmq.backend.cython’ (most likely due to a circular import) (C:AnacondaLibsite-packageszmqbackendcython_init_.py)
[W 11:12:05.257 NotebookApp] KernelRestarter: restart failed
[W 11:12:05.264 NotebookApp] Kernel af549d07-bd5d-4674-aad0-d0504f9d3a00 died, removing from map.

Hi @mikekwabs — thanks for the ping. The core failure is that the kernel is failing to start. Why the kernel fails to start can be due to a myriad of things (37 actually 😄 ) that usually require some analysis of logged traceback information. Unless obvious, I usually try to find an error string repeated in the traceback — typically on every restart attempt — and google that.

In this specific case, a search for «ImportError: cannot import name ‘constants’ from partially initialized module ‘zmq.backend.cython’» would have led to a couple of closed issues (#5543, #5689) — both of which suggest tickling the pyzmq installation. I would start there.

Hey Kevin Bates, I am struggling the same here!

Источник

Hi All,

Has anyone had success running Jupyterlab on their pixelbook? I’m on the dev channel — build 68.0.3437.0 — and have been playing with Crostini for a day or two. apt-get is installing things, and I can run them without issues, but I am having trouble with Jupyter/jupyterlab — if I run:

python3 -m jupyterlab

I can see the output from Jupyterlab starting its server:

[I 17:32:49.533 LabApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[W 17:32:49.927 LabApp] JupyterLab server extension not enabled, manually loading...
[I 17:32:49.940 LabApp] JupyterLab beta preview extension loaded from /home/*username*/.local/lib/python3.5/site-packages/jupyterlab
[I 17:32:49.941 LabApp] JupyterLab application directory is /home/*username*/.local/share/jupyter/lab
[I 17:32:49.948 LabApp] Serving notebooks from local directory: /home/*username*
[I 17:32:49.948 LabApp] 0 active kernels
[I 17:32:49.948 LabApp] The Jupyter Notebook is running at:
[I 17:32:49.948 LabApp] http://localhost:8888/?token=1db5c6389dc60463b1d238c2ae0db228e1d52e0cc61b4b7f
[I 17:32:49.948 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 17:32:49.949 LabApp] 
    
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=1db5c6389dc60463b1d238c2ae0db228e1d52e0cc61b4b7f&token=1db5c6389dc60463b1d238c2ae0db228e1d52e0cc61b4b7f

And waiting for me to connect — but when I try to do so (from Chrome) I get a localhost refusing connections error — I’m guessing it’s DNS related or that there’s really strong IPTables filtering going on that’s preventing connections to 127.0.0.1 — has anyone been able to get around this? Interestingly, Jupyterlab opens the link automatically when it starts, but that IP address is in the 100.115.92.XXX range, rather than local.

Has anyone had luck with Jupyter/JupyterLab? It’s definitely my preferred python environment if I can get it running — alternatively, I might set up an AWS instance and connect to that now that I have a terminal I can do it on, but honestly I’d love to have a local instance for offline (e.g. on planes) work.

Hey all, I am trying to install an old widget ipyauth in jupyter lab. I tried to do this on my local machine (in a ve) with:

python3 -m venv ve3
source ve3/bin/activate
pip install pandas jupyter jupyterlab scikit-learn matplotlib
pip install ipyauth
jupyter labextension install @jupyter-widgets/jupyterlab-manager 
jupyter labextension install ipyauth
jupyter labextension list

The output looks successful:

JupyterLab v3.2.5
/Users/joe.parks/scratch/ve3/share/jupyter/labextensions
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /Users/joe.parks/scratch/ve3/share/jupyter/lab
        ipyauth v0.2.6 enabled OK

But when I run jupyter lab and open a notebook to enable the extension with:

from ipyauth import ParamsAuth0, Auth

p = ParamsAuth0(...)
a = Auth(params=p)
a

I get a bunch of javascript errors in the console (will paste in thread).
In the notebook it purely says: Error displaying widget: model not found

I am wondering if there is just some fundamental incompatibility with the newest version of jupyter lab and this unmaintained extension. I was reading around the net and it seemed like jupyter lab has good backward compatibility support.

5 replies

Good day! How can I debug an extremely slow performing remote JLab once I excluded general network connection speed? Symptom: Clicking on Save takes more than 10 seconds turn-around time to get the «Changed» icon change to «No changes» meaning that the Save was finally confirmed to have happened. I compare this on two machines that have a similar connection machine with me of about 500 kB/s as confirmed per scp. One machine I get the save feedback within a second, almost feeling instantenous, on the other machine, as I said, more than 10 seconds. Any tips what I could look at appreciated!

19 replies

When installing JupyterLab dev environment, :+1: Node.js 16, :-1: Node.js 17

17 replies

Dmitrii — Demenev

@JohnScience

Matt Henderson

@mlhenderson

I ran into a css side-effect problem between an extension and a python module injecting html/css in notebook cells via repr. That specific problem was solved, but I wanted to find out how to deal with an extension conflict besides uninstalling it. It looks like disabled extensions can still have css loaded (appears in the DOM regardless of disabled or enabled). I wanted to check to see how a disabled extension is handled, whether it makes sense to prevent a disabled extension from importing anything, or if the only resolution is to uninstall. The context is a centrally managed Lab install where many extensions may exist, but users can choose to enable or disable specific extensions for themselves out of that set.

1 reply

Manuel Schmidt

@schmidi314

Hi. I just saw that you’re discussing to remove the ToC content preview ( https://github.com/jupyterlab/jupyterlab/issues/9647#issuecomment-965612826 ), or do I misunderstand this? If not, I would like to vote for not deleting it, since I’m using it a lot in conjunction with tag filtering in an extension I wrote recently (jupyterlab_scenes).

12 replies

Manuel Schmidt

@schmidi314

scenes.gif

Manuel Schmidt

@schmidi314

Is there any way to log onto a github workfow runner and inspect the font configuration? I mean, which fonts are installed and which ones are used by the chromium browser in the playwright test cases.

5 replies

Taras Shapovalov

@shapovalovts

Hey guys, I am developing a new extension and stuck trying to make standard node.js modules (like https or fs) work in my index.ts. I am using JupyterLab 3.0.12. In my tsconfig.json I have "types": [ "node" ] and "typeRoots": [ "node_modules/@types" ]. When I try to call const fs = require('fs'); in index.ts then jlpm run build fails on ModuleNotFoundError: Module not found: Error: Can't resolve 'fs'. I searched for fs module in my node_modules directory and can’t see it. There are other similar directories like ./node_modules/@nodelib/fs.walk, but not fs. As far as I understand it should be a standard node.js module. Does anyone know what I should look at to get it working?

11 replies

Gitpod and JupyterLab! What does an ideal contributor workflow look like? I have questions! Details in thread…

13 replies

So I’ve been mapping out the component hierarchy (so to speak) of the JupyterLab UI and I was wondering if somebody else has already done this… something like a front-end architecture diagram…

3 replies

Peyton Murray

@peytondmurray

Hey all, I wrote a custom ContentsManager, but I’m having an issue where the frontend seems to update the name of an open notebook even if I have not implemented file renaming:

class MyContentsManager(ContentsManager):
    def rename_file(self, old_path, new_path):
        return

While using this ContentsManager, if you open a new notebook and rename the open notebook, the name of the open tab gets changed to the new name — even though this method does nothing. Am I using this incorrectly? Does anyone know where I can find where methods of the ContentsManager are called?

1 reply

I’m getting a ton of these warnings in my console, what are these about?

[W 2021-12-23 16:37:44.443 ServerApp] 401 POST /login?next=%2Ftree%3F (211.193.31.108) 70.35ms referer=None

basically one warning every 5 seconds or so, am not used to getting those?

Hello, I am not sure is it «bug report» or «feature request». If you try to stop jupyter lab in CLI by pressing Ctrl+C, it asks you for confirmation, and default option is «No». However, if you have non-latin locale, it asks you (example for Russian):
Shutdown this Jupyter server (д/[н])?
and if you press anything except «д», it is interpreted as «no», even «y» is interpreted as «no». It is very uncomfortable, because you have to change keyboard layout.
So my question is: what kind of issue should I create — «feature request» or «bug repost»?

2 replies

i use the jupyterhub to support 20users deal data in python kernels.
The jupyterhub is installed as the GitHub — jupyterhub/jupyterhub: Multi-user server for Jupyter notebooks described .
jupyterhub include jupyterlab /jupter_server/notebook/juupyter_core and so on ,i want add some functions to jupyterhub.
i want to add my own custom handlers on jupyterhub platform to deal some request from browser .
i add a new handler on the jupyter_server( v1.11.1)[GitHub — jupyter-server/jupyter_server: The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.] in the jupyter_serverjupyter_serverservicesapihandlers.py .
the add content :
class UserCustomHandler(APIHandler):
“”»
User Customization function
“”»
_track_activity = False

@web.authenticated
def get(self):

# 
with open("/tmp/test.txt", 'a', encoding="utf-8") as f:
    f.write("====begain run in UserCustomHandler=====")

the default handler:
default_handlers = [
(r»/api/spec.yaml», APISpecHandler),
(r»/api/status», APIStatusHandler),
(r»/api/customhandler», UserCustomHandler),
]
then i build and install the jupyter_server in my jupyterhub.
i send the request to http:ip:9000/user/lihua//api/customhandler but it does not work .

who can tell me how to add a new handler in jupyter_server of jupyterhub platform or add a new handler directly on jupyterhub source code or add a new handler on jupyterlab ?

thanks.

the version information

notebook==6.4.0
jupyter-client==6.2.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.7.1
jupyter-hdfscm==0.2.0+0.g427e8c8.dirty
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
jupyter-resource-usage==0.6.0
jupyter-server==1.11.1
jupyterhub==1.0.0
jupyterhub-yarnspawner==0.4.0+2.g1c40f52.dirty
jupyterlab==3.2.1
jupyterlab-pygments==0.1.2
jupyterlab-server==2.8.2
jupyterlab-system-monitor==0.8.0
jupyterlab-topbar==0.6.1

Frédéric Collonval

@fcollonval

Reminder: there won’t be a JupyterLab weekly meeting later today. See you all on the next one on January 5th 2022.

Frédéric Collonval

@fcollonval

I’m getting test integrity failure on my PRs today on the CI (example). But locally, nothing shows up.

looks like it’s happening on most PRs now

I am running Jupyter Lab and seeing warning messages indicating that the application is trying to locate an old file that I removed from the host several months ago:

[W 00:28:11.617 LabApp] 404 GET /api/contents/git/canaddress/scripts?type=directory&_=1640105637903 (127.0.0.1): No such file or directory: git/canaddress/scripts
[W 00:28:11.617 LabApp] No such file or directory: git/canaddress/scripts

I have looked for mention of this file in the .jupyter and .ipython directories but I’ve not found anything. I assume that there’s some record of this file being part of the workspace and the Jupyter Lab application is trying to get the contents again but failing to find any. Is this the case? If so then how can I clean house?

3 replies

Hi,everybody,I have a question I want to discuss with everyone. Now we are currently using jupyter to provide a training environment for algorithm engineers,They can extract data from data sources such as hive and mysql and perform training. But at the same time we don’t want them to bring the data outside of Jupyter because we are a financial institution, there are a lot of sensitive customer data in it.At the beginning I disabled the download function on jupyter,But they can still copy and paste the data to the outside. If i disable the copy function, it will cause a lot of inconvenience to everyone’s use.does someone have any good solutions

Hi,everybody,I have a question I want to discuss with everyone. Now we are currently using jupyter to provide a training environment for algorithm engineers,They can extract data from data sources such as hive and mysql and perform training. But at the same time we don’t want them to bring the data outside of Jupyter because we are a financial institution, there are a lot of sensitive customer data in it.At the beginning I disabled the download function on jupyter,But they can still copy and paste the data to the outside. If i disable the copy function, it will cause a lot of inconvenience to everyone’s use.does someone have any good solutions

i have an idea,currently we have a gateway service that can desensitize sensitive data.Is it possible to ensure data security by accessing gateway services,I looked at the request at the runtime of jupyter, and I have captured the request to open the file, and there will be specific information about the content of the file in the response.But when running the code in the cell, I did not get the request containing the running result

2 replies

making a new 4.0.0a18 release now

2 replies

I noticed that wrong credentials for a password-secured notebook server lead to no notification about that trial in the log. Is there a way to make it more obvious that someone tries to enter a notebook/lab server without having the credentials?

Frédéric Collonval

@fcollonval

Milestone 3.3.x and branch 3.3.x have been created
ETA for JupyterLab 3.3.0rc0 is end of January

PR #11718 that was targeting 3.3 has been reverted on 3.2.x and backported on 3.3.x. So 3.2.x stays clear if we need to do additional patch release before 3.3.0rc0.

I have a working ipywidget. It’s installed according to the development instructions and it works fine. However, are there any instructions on how to package it into a wheel so I can distribute it? I installed build and executed python -m build. It built a wheel, but when I install it into an environment and try to import it into JuyterLab and display it, I get the message: Error displaying widget: model not found

3 replies

elainenleuze

@elainenleuze

I’m brand new and can’t locate notebooks previously worked on.

starting a 3.2.6 release now

9 replies

Does anyone know of a way to get syntax highlighting for ‘.cs’ (C#) files in JupyterLab? Right now I’m just using the built-in text editor to open and edit these files on the fly. I’m wondering if there exists an extension or some other workaround I could use to get basic syntax highlighting? Thanks for any help!

8 replies

Hi. Does anyone know if it is possible to develop jupyterlab extensions in python?

15 replies

Also, is it possible to trigger a jupyterlab extension by running a function in a notebook cell (in Python). And if so, is it possible to also read the values from the cell? More specifically, I currently have an extension that is just a command in the menu which executes a fixed function when clicked. I would like to extend this extension so that the same command could be executed by running a python method in a notebook cell, and preferably be able to add parameters to this method that would be added to the extension function. E.g. if the menu command currently prints «Hello, World» to the console, I’d like to run execute_hello("Tom") in a notebook cell which would trigger the same function but pass in «Tom» instead of «World», but again print the result to the console. Thanks for any recommendations!

4 replies

Angus Hollands

@agoose77:matrix.org

[m]

@smejak: yes, the simplest way is to publish a mime bundle from ipython via display(), and use a mime-render extension to pick this up in the front end

1 reply

Peyton Murray

@peytondmurray

Hey all, what is the right way of listing the installed jupyter extensions? jupyter labextension list only shows 3rd party extensions I’ve installed — I’m more interested in listing extensions (and plugins for those extensions) that are built-in to jupyterlab — for example, @jupyterlab/docmanager-extension:download.

2 replies

Hi everyone, does anyone know how npm packages are handled in jlpm? I am trying to import a built in npm package in my jupyterlab extension but when I run jlpm run build I get a long error message saying ‘node_modules doesn’t exist or is not a directory’. The error message also mentions @jupyterlab and webpack but I’m not really sure how to interpret it. Thank you for any suggestions

10 replies

starting a couple of releases: 4.0.0ax -> 3.2.x -> 3.1.x -> 3.3.x (last one if there is time)

Hey. So I got over my previous issues with webpack, but now I’m wondering how I can pass a string from my typescript file to ipylab. The string is only generated once I run app.commands.execute('command') within the extension’s index.ts, but I’m not sure how I can access it with ipylab. I hope I’m not spamming this channel, the suggestions here have been extremely helpful.

15 replies

starting a 3.3.0a1 pre-release now

6 replies

currently releasing a new 3.2.8 based on the discussion in jupyterlab/jupyterlab#11433 and the recent issues related to the lumino update

3 replies

Angus Hollands

@agoose77:matrix.org

[m]

Has anyone experienced certain keys getting swallowed in JupyterLab (it seems keys which are also commands, e.g. c) and require a browser restart?

1 reply

Did anyone encounter this error before? Error: widget model not found
at x.get_model at u.renderModel
It’s in the console when running jupyterlab with an extension installed that is supposed to display commands in the top menu. The extension is correctly rendering the label in the panel, but when I click it the commands don’t appear. Other than this error in the console everything compiles. Thank you for any suggestions.

4 replies

Tradefeedr

@tradefeedr_twitter

jupyterlite good go use?

10 replies

Понравилась статья? Поделить с друзьями:
  • Jungheinrich погрузчик ошибка 1123
  • Jungheinrich ошибка pre op
  • Jungheinrich ошибка 3167
  • Jungheinrich ошибка 3164
  • Jungheinrich ошибка 1310