[python] 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

This question is related to python jupyter-notebook jupyter

The answer is


It's just the incorrect lines of code you were trying to execute..

  1. You need to turn off your antivirus (if have).
  2. Restart Jupyter Notebook.
  3. Copy your code then delete the cell you were working on.
  4. Rewrite code and make sure you are not doing any mistakes.
  5. Find the missed/wrong lines of code specially increment operators and correct them.

hope it help..


I had the same problem, and the little star means that the kernel is still working. So the program is trapped in an endless while loop. So you only have to the rewrite the code


I had the same problem and not any of the above mentioned solutions worked.

Until I updated conda packages:

 conda update conda
 conda update anaconda

and ... Voila! It all works!


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.


I have the same issue and I did this: I went to windows option (the icon), then I chose the option Anaconda Prompt then a small windows show up with the prompt like this: c:\user\computer name> then I type this: c:\user\computer name>jupyter notebook
then enter and that's it. I hope that helps


The answers that state that your kernel is still executing the code in the cell are correct. You can see that by the small circle in the top right. If it is filled with a black/grey color, then it means it is still running.

I just want to add that I experienced a problem in JupyterHub where the code in the cell would just not execute. I stopped and restarted the kernel, shutdown and reloaded the notebook, but it still did not run.

What worked for me was literally copy pasting the same code to a new cell and deleting the old one. It then ran from the new cell.


I have installed jupyter with command pip3 install jupyter and have the same problem. when instead I used the command pip3 install jupyter ipython the problem was fixed.


I had the same issue now:

Solved it by:

Just reloading the local weblink in which the Python is running

http://localhost:8888/notebooks/sec%201/Untitled.ipynb

I have uninstalled jupyter, notebook and ipython, and installed jupyterlab. It is working for now (with just a few libraries installed and Python 3.6.8.


Something to discard: Uninstalling Python 3.7 completely with his libraries and reverting to 3.6 doesn't fix it, although it improves it, it works intermittently now (but once sth doesn't work properly, things start to get worse and worse, so I did the above).


From my experience, it usually means one of the prior cells is keeping the kernel busy. When you hit run on the intended cell and [*] appears, from there, try to scroll up to the prior cell which is also advertising a [*]. Then goto kernel->interrupt, and lastly, try running the cell again.


If you have ad block installed in your browser, just switch it off and then stop the kernel and start again. now the code will execute


The * shows up when kernel is running some other program, it might have stuck in some kind of infinite loop. Pressing stop button at the top to stop the kernel, It might fix the problem...


Based on you kernel status (upper right beside "Python 3", the one that is a circle). It seems that it is still busy. It might be trapped in an endless loop or maybe you've run/display something that is not closed.


enter image description here

This is mean your program is still running in background, you need to click shutdown (Shown in attached Image).

*** Shutdown the Running cell and again run your program.


Check the output on the server environment from which jupyter notebook was launched if you can. You'll probably find error messages and print() results.


pip install ipykernel --upgrade

https://github.com/jupyter/notebook/issues/1133


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


This is because when we run a loop until it's termination the Kernel is in busy state and so IN [*] is shown up. Since Kernel is busy and if we just leave that cell to execute completely and switch to another cell to run, the corresponding cell will get busy and so again for that cell IN[*] is shown. In that case you just need to restart your jupyter notebook and all is fine then.

But be sure that your loop will terminate this time or else again this error will turn up.


Usually, stopping and restarting that particular cell fixes this issue.


Upgrading ipykernel, notebook and then downgrading tornado to 4.2.0 solved the issue for me.

My current package versions related to jupyter:

jupyter==1.0.0
jupyter-client==5.2.2
jupyter-console==6.1.0
jupyter-core==4.4.0
jupyterlab==2.2.5
jupyterlab-server==1.2.0
ipykernel==5.3.4
notebook==5.2.2
tornado==4.2
pyparsing==2.4.2
ipython==5.5.0
ipython-genutils==0.2.0
prompt-toolkit==1.0.15

Github


usually, it is solved with restarting the Kernel on jupyter notebook.


I have fix for this issue,

example if you are assigning some values to DataFrame

[*] symbol has shown this because of the script running

to see the outout of the script have to mention df like this, output


Sometimes the extensions also create a problem. I was using a dark mode extension(Night Eye) in Microsoft edge. So kernel was busy. When I uninstalled it. It working fine.


What I did was to quit the Notebook, and I started all over again. That is the proper solution. Restarting the Kernel really did not really help. But quitting did so try quitting and start again


pip install prompt -toolkit~2.0.9 pip install --upgrade ipython conda update jupyter_core jupyter_client


I had the same issue. I found that ipython must be running for jupyter notebook to execute. Do the following:

  • Go to the folder where you have your ipython notebook(.ipynb)
  • Press shift and right click on the empty space then select "open command window here". This will open a command prompt window.
  • Type ipython. This will start ipython.
  • Open another command prompt window and open jupyter notebook.
  • Open your file again and go to cell>>>run cell.

This should work. It worked for me. Cheers!


I fixed this issue

just only type this command: jupyter notebook --no-browser

It will show you the path then copy and paste on Jupyter Notebook browser

The code will be executed in IPython Notebook Python 3


I had the same problem.

In Jupyter main menu:

1) Kernel -> Shutdown 2) Kernel -> Restart


Examples related to python

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

Examples related to jupyter-notebook

How to prevent Google Colab from disconnecting? Jupyter Notebook not saving: '_xsrf' argument missing from post How do I install Python packages in Google's Colab? What is the difference between Jupyter Notebook and JupyterLab? Importing .py files in Google Colab Display all dataframe columns in a Jupyter Python Notebook How to open local file on Jupyter? how to open Jupyter notebook in chrome on windows Change the Theme in Jupyter Notebook? Jupyter notebook not running code. Stuck on In [*]

Examples related to jupyter

How to increase image size of pandas.DataFrame.plot in jupyter notebook? What is the difference between Jupyter Notebook and JupyterLab? Removing Conda environment How to open local file on Jupyter? Jupyter notebook not running code. Stuck on In [*] Can I run Keras model on gpu? IOPub data rate exceeded in Jupyter notebook (when viewing image) How to execute a * .PY file from a * .IPYNB file on the Jupyter notebook? how to make a new line in a jupyter markdown cell Running Jupyter via command line on Windows