question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timed out waiting to get a heartbeat from kernel process

See original GitHub issue

Environment data

  • VS Code version: 1.51.1
  • Extension version (available under the Extensions sidebar): XXX
  • Jupyter Extension version (available under the Extensions sidebar): v2020.11.358541065
  • OS (Windows | Mac | Linux distro) and version: Linux x64 4.19.0-11-amd64
  • Python and/or Anaconda version: Python V==3.7, Anaconda V==2020.07
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Jupyter server running: Local

Expected behaviour

Run selected cells and provide relevant output

Actual behaviour

The vs code doesn’t provide any output to for the running cell in .ipynb

XXX

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Clicking on ipynb file loads the jupyter extension, Which in turn calls the jupyter notebook extension. This sometimes gives an error stating ‘Timed out waiting to get a heartbeat from kernel process’

But for reference, the following code was constituted in the ipynb file:-

import tensorflow as tf
import numpy
import matplotlib.pyplot as plt

def preprocess(dataset):
    import pandas as pd
    import numpy as np
    from sklearn.model_selection import train_test_split

    print('[INFO] cleaning dataset')
    df = pd.read_csv(dataset)
    df.drop(['user_id','account_id'],axis = 1)
    df.replace([np.inf, -np.inf], np.nan, inplace=True)
    df.fillna(df.mean(), inplace=True)

    print('[INFO] train test split')

    #importing train test split
    X = df.drop(['target'],axis = 1)
    y = df['target']
    X_train, x_test, Y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=123)
    return(X_train, x_test, Y_train, y_test)


X_train, x_test, Y_train, y_test = preprocess(r'taskdata.csv')

Logs

/media/nik/Media/Conda/envs/TFDS/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py -c “import notebook” /media/nik/Media/Conda/envs/TFDS/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py -c “import jupyter” /media/nik/Media/Conda/envs/clipper/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py -c “import ipykernel” /media/nik/Media/Conda/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py -c “import ipykernel” /media/nik/Media/Conda/envs/TFDS/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py jupyter kernelspec --version /media/nik/Media/Conda/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py -c “import ipykernel” /media/nik/Media/Conda/envs/TFDS/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v /media/nik/Media/Conda/envs/TFDS/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v /media/nik/Media/Conda/envs/TFDS/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v /media/nik/Media/Conda/envs/clipper/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v /media/nik/Media/Conda/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v /media/nik/Media/Conda/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v Error 2020-11-19 22:47:07: Kernel died [r [Error]: Traceback (most recent call last):

at t._next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:762779)
at t.__tryOrUnsub (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:5463)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:4632)
at t._next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:3736)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:3407)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:8976)
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:9:108204
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:428264
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:428482
at Immediate._onImmediate (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:430047)
at processImmediate (internal/timers.js:439:21)] 

Error 2020-11-19 22:47:07: Kernel died [r [Error]: Traceback (most recent call last):

at t._next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:762779)
at t.__tryOrUnsub (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:5463)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:4632)
at t._next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:3736)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:3407)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:8976)
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:9:108204
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:428264
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:428482
at Immediate._onImmediate (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:430047)
at processImmediate (internal/timers.js:439:21)] 

Error 2020-11-19 22:47:36: Timed out waiting to get a heartbeat from kernel process. Error 2020-11-19 22:47:36: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process. Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Timed out waiting to get a heartbeat from kernel process. Error 2020-11-19 22:47:36: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process. Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: Failed to determine if a notebook is active for the current editor [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:47:36: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)]

/media/nik/Media/Conda/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py -c “import ipykernel” /media/nik/Media/Conda/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v Error 2020-11-19 22:48:12: Kernel died [r [Error]: Traceback (most recent call last):

at t._next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:762779)
at t.__tryOrUnsub (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:5463)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:4632)
at t._next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:3736)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:3407)
at t.next (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:32:8976)
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:9:108204
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:428264
at /home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:428482
at Immediate._onImmediate (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:47:430047)
at processImmediate (internal/timers.js:439:21)] 

Error 2020-11-19 22:48:41: Timed out waiting to get a heartbeat from kernel process. Error 2020-11-19 22:48:41: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process. Error 2020-11-19 22:48:41: Exception attempting to start notebook: [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:48:41: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:48:41: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)] Error 2020-11-19 22:48:41: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process. at m.waitForHeartbeat (/home/nik/.vscode/extensions/ms-toolsai.jupyter-2020.11.358541065/out/client/extension.js:49:646443)]

The code never returned any output

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
DonJayamannecommented, Nov 24, 2020

Looks like ipykernel is not installed properly on your environment. Please could you try installing ipykernel into your environment manually.

0reactions
Nikhil1O1commented, Nov 24, 2020

wait, Is this happening because ipykerel is missing in my current venv??

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timed out waiting to get a heartbeat from kernel process #582
Hello All, I am having issues with my jupyter notebook on my vscode. I am using python 3.8.3 on windows 10. Also, I...
Read more >
Is anyone else having an issue running Visual Studio Code?
I got an update on 9/23/2020 and it worked for most of the day but suddenly I get an error of "Timed out...
Read more >
Detecting Dead TCP Connections with Heartbeats ... - RabbitMQ
Setting heartbeat timeout value too low can lead to false positives (peer being considered unavailable while it is not really the case) due...
Read more >
Multi thread julia kernel (jupyter) fails to start under vscode ...
The kernel does not start : Timed out waiting to get a heartbeat from kernel process. Single threaded notebooks are ok.
Read more >
Resolved Issues in ArubaOS 8.7.0.0 - Aruba Networks
New Bug ID Old Bug ID Reported Version AOS‑119600. AOS‑202348 143771 ArubaOS 8.2.0.0 AOS‑125897 151952. 191568 ArubaOS 8.0.1.0 AOS‑143514. AOS‑143768. AOS‑184333. AOS‑203809 174823. 175163 ArubaOS 8.2.0.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found