title: KernelRestarter: restart failed in jupyter , Kernel died
body: <pre><code>[I 10:43:53.627 NotebookApp] 启动notebooks 在本地路径: /opt/soft/recommender/jupyter
  
  [I 10:43:53.627 NotebookApp] 本程序运行在: http://10.48.204.120:8888/
  
  [I 10:43:53.627 NotebookApp] 使用control-c停止此服务器并关闭所有内核(两次跳过确认).
  
  [W 10:43:53.628 NotebookApp] 没有找到web浏览器: could not locate runnable browser.
  
  [I 10:44:11.697 NotebookApp] Kernel started: 7ea0717b-b85b-44b1-bd10-7a2079b24d94
  
  [I 10:44:11.708 NotebookApp] 302 GET /notebooks/doc/source/images/als-diagram.png (10.252.183.252) 6.63ms
  
  [I 10:44:14.691 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
  
  [I 10:44:17.719 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
  
  [I 10:44:20.746 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
  
  [I 10:44:23.774 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
  
  [W 10:44:26.800 NotebookApp] KernelRestarter: restart failed
  
  [W 10:44:26.801 NotebookApp] Kernel 7ea0717b-b85b-44b1-bd10-7a2079b24d94 died, removing from map.
  
  [W 10:45:11.836 NotebookApp] Timeout waiting for kernel_info reply from 7ea0717b-b85b-44b1-bd10-7a2079b24d94
  
  [E 10:45:11.839 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 7ea0717b-b85b-44b1-bd10-7a2079b24d94)
  
  [I 10:46:11.948 NotebookApp] Saving file at /notebooks/elasticsearch-spark-recommender.ipynb
  </code></pre>
  
  <p>I am trying to start jupyter notebook through pyspark, using command:</p>
  
  <pre><code>PYSPARK_DRIVER_PYTHON="jupyter" PYSPARK_DRIVER_PYTHON_OPTS="notebook"
  ../spark-2.2.0-bin-hadoop2.7/bin/pyspark --driver-memory 4g --driver-class-path /opt/soft/recommender/spark/elasticsearch-hadoop-5.3.0/dist/elasticsearch-spark-20_2.11-5.3.0.jar
  </code></pre>
  
  <p>I can open jupyter by remote browser, but because kernel restart failed, I can't run python demo by jupyter.</p>
  
  <p>The python version is 3.5.0. Jupyter and ipykernel all up-to-date. <code>prompt-toolkit</code> version is 1.0.15.</p>
  
  <p>If I update <code>prompt-toolkit</code> version to 2.0.4, then starting pyspark will throw a lot of error messages.</p>
  
  <p>How can I fix it?</p>