Forums

Python Kernel stuck in 'busy'

Hi,

My 3.6 Kernel seems to be stuck so I can't run notebooks. Moreover, my tasks don't run. I've tried to restart the kernel with no success as well as killing all processes and switching the notebook to another kernel (which then works) and back to 3.6. How can I fix that kernel?

THanks,

Elvin

Do you have any packages installed using pip with the --user flag that may be preventing the kernel from starting. You can see the installed packages in ~/.local/lib/python3.6/site-packages.

I could very well as right before the problem I tried to install handcuffs. However, how would I know now which package is preventing it from restarting? And then after, how can I resolve this?

These are the ones that I have installed (if that helps):

IPython/
PyVirtualDisplay-0.2.1.dist-info/
Send2Trash-1.5.0.dist-info/
pycache/
plotly_future/
_plotly_utils/ airtable/
airtable-0.3.1.dist-info/
airtable_python_wrapper-0.12.0.dist-info/
backcall/
backcall-0.1.0.dist-info/
chart_studio/
colorlover/
colorlover-0.3.0.dist-info/
cufflinks/ cufflinks-0.15.dist-info/
helper/
ipython-7.5.0.dist-info/
ipywidgets/
ipywidgets-7.4.2.dist-info/
jedi/
jedi-0.14.0.dist-info/ notebook/
notebook-5.7.8.dist-info/
parso/ parso-0.5.0.dist-info/ pkg_resources/ plotly/
plotly-3.10.0.dist-info/
plotlywidget/
prometheus_client/ prometheus_client-0.7.1.dist-info/ prompt_toolkit/
prompt_toolkit-2.0.9.dist-info/
pyvirtualdisplay/
pyzmq-18.0.2.dist-info/
retrying-1.3.3.dist-info/
send2trash/
setuptools/
setuptools-41.0.1.dist-info/
terminado/ terminado-0.8.2.dist-info/ widgetsnbextension/
widgetsnbextension-3.4.2.dist-info/
zmq/

And this is probably the culprit (task) as it has been using a lot of CPU:

/usr/local/bin/python3.4 /usr/local/bin/jupyterhub-singleuser --user=nivvle --port=42664 --cookie-name=jupyter-hub-token-nivvle --base-url=/user/nivvle --hub-prefix=/hub/ --hub-api-url=http://127.0.0.1:8081/hub/api --ip=localhost --debug

And/or this one, which has also been running ever since I'm having this problem:

/usr/local/bin/python3.6 -m IPython.kernel -f /home/nivvle/.local/share/jupyter/runtime/kernel-0415e3c0-b2d9-4983-aef9-6a7f2c6ec924.json

Have you tried killing those processes?

To find the culprit, delete or uninstall the installed packages and install them on-by-one until you find the one that is causing the problem.

The thing is, I deleted all packages (manually, not using pip) as well as killed all processes multiple times. On top of that, I've reinstalled notebook. I'm still not able to restart the kernel though..

Is it always the same notebook? Have you tried a new notebook with a 3.6 kernel?

No it's not. I've opened new ones (that open in 3.5 without a problem). Upon switching to 3.6:

Dead kernel The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened.

Ok. It looks to me like you have a version of IPython installed in /home/nivvle/.local/lib/python3.6/site-packages/ that is not compatible with our notebook server. Remove it and see if that helps.

Okay killed all processed, uninstalled ipython with pip3.6, emptied the entire site-packages folder and now it works again... Oef.. Thanks for the help!!

No problem. Glad we got there.

hi, i use ipython version 3.6 and i installed tflearn library, but its say :

Note: you may need to restart the kernel to use updated packages.

how can i do restart ?

When you are in the notebook in the "Kernel" menu there is a "restart" option.