Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter notebook not running code. Stuck on In [*]

My code was running fine before I did not change anything and I ran it again. Now it doesn't return anything not even an error. It is just stuck on "In [*]".

See problem visually here

like image 671
tedd Avatar asked Sep 23 '17 18:09

tedd


People also ask

Why is Jupyter notebook not running my code?

Jupyter doesn't load or doesn't work in the browserTry disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have security software, try turning it off temporarily, and look in the settings for a more long-term solution.

What does [*] mean in Jupyter notebook?

This means that your kernel is busy. If you want to interrupt/stop the execution, go to the menu Kernel and click Interrupt. If it doesn't work, click Restart. You need to go in a new cell and press Shift + Enter to see if it worked. Follow this answer to receive notifications.

Why is my Jupyter notebook not connecting to kernel?

Before we get into the solutions, what is a kernel error? A kernel error occurs basically when you try opening a python 3 file in the wrong directory. The truth is Jupyter and Python are two different software entirely. So, a kernel error occurs when Jupyter fails to connect with a specific version of Python.

How do you unfreeze a Jupyter notebook?

To restart the kernel,press Esc to enter command mode, then press 0 0 (zero) to restart the kernel, now your program will run. To avoid this in the future, remember to complete the execution of your program before editing the code.


2 Answers

This means that Jupyter is still running the kernel. It is possible that you are running an infinite loop within the kernel and that is why it can't complete the execution.

Try manually stopping the kernel by pressing the stop button at the top. If that doesn't work, interrupt it and restart it by going to the "Kernel" menu. This should disconnect it.

Otherwise, I would recommend closing and reopening the notebook. The problem may also be with your code.

like image 73
SioSMac Avatar answered Oct 09 '22 07:10

SioSMac


updating ipykernel did it for me. it seems arch linux's ipykernel package had been outdated for some time

just do pip install --upgrade ipykernel

reference here: github solution

like image 36
Itachi Avatar answered Oct 09 '22 08:10

Itachi