python – Need to restart Jupyter/IPython kernel every time an error is thrown somewhere

I’m using Jupyter Notebook on a Windows 10 machine to write my analysis scripts and every time there is an error somewhere in my script (i.e. the execution of a cell is interrupted with an error message) I have to kill and restart the entire kernel. Otherwise, none of the cells will execute. What is this behavior and can this be changed somehow? Killing and restarting the kernel is extremely annoying, as I’m losing all my variables etc. from previous calculations, so I need to rerun the entire script cell by cell.

Also, I often have to “force” a cell to execute by pressing Shift+Enter twice, because after the first time the cell would just stay busy indefinitely (showing (*)). But I’m not sure if this is related to the problem of having to restart the kernel all the time…

Let me know if you need me to provide any information regarding my system, the installation etc. (I went the usual way to install pip using get-pip.py, then Jupyter via pip install, then all the Python packages I need for my work).