Search code examples
pythonjupyter-notebooktornadobokehdata-science-experience

Installing "bokeh" library upgrades Tornado to the version 5 that causes an issue with starting Python kernel in DSX Notebook


I upgraded bokeh library by executing the following command:

!pip install --user --upgrade bokeh

Tornado version 5 dependency was installed. After upgrading the library from the DSX Notebook the kernel stops responding after restart. I see "Slow Kernel connection" dialog. Opening another notebook for the same language displays the same error dialog.


Solution

  • Tornado 5.0 is incompatible with the current ipython kernel installation for DSX Notebooks. If you are experiencing "Slow kernel connection" issue after upgrading Bokeh library try the following steps:

    • Switch to Python kernel with another version (e.g. if you installed Tornado 5 for "Python 2" kernel, switch kernel to "Python 3.5")
    • Execute the following command in the notebook code cell: !rm -rf ~/.local/lib/ This command will remove all python packages installed by user
    • All Python kernels should be started normally

    If Tornado 5 was installed for both Python versions (Python 2 and Python 3) you could remove user's packages by switching to R kernel and executing the following command:

    system('!rm -rf ~/.local/lib/')

    After that you could switch back to Python kernel.

    You could upgrade bokeh library with the following command:

    !pip install --upgrade --upgrade-strategy only-if-needed bokeh

    In this case Tornado package will not be updated