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

Bugs: Can't interrupt kernel and the terminal shows Chinese words when starting #6186

Open
Beliefuture opened this issue Sep 25, 2021 · 6 comments

Comments

@Beliefuture
Copy link

Describe the bug

  1. I just can't interrupt the kernel when I press the button in the notebook. But I can shutdown the kernel with the shutdown button outside the notebook.
    image
    image

  2. Every time I run the terminal, it displays some Chinese words. But the program can run smoothly.
    image

Desktop:

  • OS: windows 10
  • Browser: Edge
@Beliefuture Beliefuture changed the title Can't interrupt kernel and the terminal shows Chinese words when starting Bugs: Can't interrupt kernel and the terminal shows Chinese words when starting Sep 27, 2021
@kevin-bates
Copy link
Member

Hello. It's not clear from your screenshot that kernel interrupts are not working. Keep in mind that they are intended to interrupt active cell operations. So if you're not executing any code at the time the interrupt button is selected, your screen will appear as though nothing happened. Try executing a 60-second sleep call, then hit the interrupt button after running the cell. You should see a traceback indicating the interrupt request was received and acted upon.

Regarding the Chinese characters, you have a localized environment configured. You can see another example of this in your "shutdown kernel" screenshot. I don't recall how localization works on Windows, but these kinds of things are typically evident in your environment. From the terminal in which these characters appear, type set to check the environment. Looks for variables like LANG (I think on Windows). You might also check for LC_-prefixed variables, although those are typically set for *nix based systems. You'll need to consult Windows docs to determine how to make the desired adjustments.

@Beliefuture
Copy link
Author

@kevin-bates Thanks for your reply. I indeed want to interrupt the running cell and try to press that button. But nothing happened. The sign beside the cell remained *. The jupyter notebook terminal also didn't print like "interrupt.....". (It can't be expressed by the picture clearly). I guess it is because of the configuration issue maybe? But I don't know where to refer.

As for the Chinese character, I guess it is because of the environment variable? But I forget where to set my configuration.

Again thanks for your answer.

@kevin-bates
Copy link
Member

@Beliefuture - thanks for the update and clarification.

As for the Chinese character, I guess it is because of the environment variable? But I forget where to set my configuration.

You'll need to consult the platform (Windows) documentation (or google search) for how localization is configured.

I guess it is because of the configuration issue maybe? But I don't know where to refer.

Regarding the lack of interrupt, I see that you're using nb_conda_kernels and suspect this is related to #5985 (or rather anaconda/nb_conda_kernels#180). Are you able to try performing an interrupt from the conda kernel that is associated with the same environment in which you started your notebook server? I would expect interrupts to work in that scenario.

@Beliefuture
Copy link
Author

Beliefuture commented Oct 22, 2021

@kevin-bates

Sorry, sir. I am not so clear about what you said performing an interrupt from the conda kernel. I can shutdown the running program using ctrl+c in the terminal and also click the outside shutdown button like below.

image

But I just can't interrupt the cell, the terminal just prints like interrupt message every time click interrupt.

[I 13:42:54.784 NotebookApp] Kernel interrupted: bb31f0bc-66e1-4a80-b27e-6e90c0a3ed89

@kevin-bates
Copy link
Member

Hi @Beliefuture. Yeah, the "Kernel interrupted" message can be a little misleading since the server doesn't really know that the kernel processing was actually interrupted, only that it initiated the interrupt. A better message from the server would probably be: "Kernel interrupt initiated ...".

At any rate, since nb_conda_kernels has an outstanding issue relative to interrupts and since you mention in #6212 that non "Python: [conda envs:xxx] prefix" kernels seem to work, could you please try interrupting a non-conda kernel? Again, I suspect this should be pursued from the nb_conda_kernels side of things, but thought this last request might provide a useful data point.

@Beliefuture
Copy link
Author

Hi @Beliefuture. Yeah, the "Kernel interrupted" message can be a little misleading since the server doesn't really know that the kernel processing was actually interrupted, only that it initiated the interrupt. A better message from the server would probably be: "Kernel interrupt initiated ...".

At any rate, since nb_conda_kernels has an outstanding issue relative to interrupts and since you mention in #6212 that non "Python: [conda envs:xxx] prefix" kernels seem to work, could you please try interrupting a non-conda kernel? Again, I suspect this should be pursued from the nb_conda_kernels side of things, but thought this last request might provide a useful data point.

Thanks for your reply, Sir @kevin-bates. Do you mean try it under the base environment like Python 3 here? If so, it still can not work.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants