Jupyter "The kernel appears to have died. It will restart automatically."

When I try to run plotly.offline.init_notebook_mode() I get an error in the Jupyter notebook that β€œThe kernel appears to have died. It will restart automatically.” Does anyone know why this might be happening?

Python 2.7
Jupyter 4.2.0
Plotly 1.9.5

I have tried upgrading the version of plotly and that does not help. Also, the problem does not occur locally it only happens on a cloud foundry app I have online.