microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 293 forks source link

Timed out waiting to get a heartbeat from kernel process #508

Closed elicutler closed 4 years ago

elicutler commented 4 years ago

I am running VS Code on Windows 10. I use poetry for env+package management.

$ code --version
1.50.1
d2e414d9e4239a252d1ab117bd7067f125afd80a
x64
# python extension version: 2020.9.114305
$ python --version
Python 3.8.5 # same version inside my virtual environment
$ poetry --version
Poetry version 1.1.3

$ poetry show
appdirs             1.4.4         A small Python module for determining appropriate platform-specific dirs, e.g. a ...
argon2-cffi         20.1.0        The secure Argon2 password hashing algorithm.
async-generator     1.10          Async generators and context managers for Python 3.5+
atomicwrites        1.4.0         Atomic file writes.
attrs               20.2.0        Classes Without Boilerplate
backcall            0.2.0         Specifications for callback functions passed in to an API
bleach              3.2.1         An easy safelist-based HTML-sanitizing tool.
cffi                1.14.3        Foreign Function Interface for Python calling C code.
cfgv                3.2.0         Validate configuration and produce human readable error messages.
colorama            0.4.4         Cross-platform colored terminal text.
cx-oracle           8.0.1         Python interface to Oracle
decorator           4.4.2         Decorators for Humans
defusedxml          0.6.0         XML bomb protection for Python stdlib modules
distlib             0.3.1         Distribution utilities
entrypoints         0.3           Discover and load entry points from installed packages.
filelock            3.0.12        A platform independent file lock.
flake8              3.8.4         the modular source code checker: pep8 pyflakes and co
identify            1.5.6         File identification library for Python
iniconfig           1.1.1         iniconfig: brain-dead simple config-ini parsing
ipykernel           5.3.4         IPython Kernel for Jupyter
ipython             7.18.1        IPython: Productive Interactive Computing
ipython-genutils    0.2.0         Vestigial utilities from IPython
ipywidgets          7.5.1         IPython HTML widgets for Jupyter
isort               5.6.4         A Python utility / library to sort Python imports.
jedi                0.17.2        An autocompletion tool for Python that can be used for text editors.
jinja2              2.11.2        A very fast and expressive template engine.
jsonschema          3.2.0         An implementation of JSON Schema validation for Python
jupyter             1.0.0         Jupyter metapackage. Install all the Jupyter components in one go.
jupyter-client      6.1.7         Jupyter protocol implementation and client libraries
jupyter-console     6.2.0         Jupyter terminal console
jupyter-core        4.6.3         Jupyter core package. A base package on which Jupyter projects rely.
jupyterlab-pygments 0.1.2         Pygments theme using JupyterLab CSS variables
markupsafe          1.1.1         Safely add untrusted strings to HTML/XML markup.
mccabe              0.6.1         McCabe checker, plugin for flake8
mistune             0.8.4         The fastest markdown parser in pure Python
mypy                0.782         Optional static typing for Python
mypy-extensions     0.4.3         Experimental type system extensions for programs checked with the mypy typechecker.
nbclient            0.5.1         A client library for executing notebooks. Formerly nbconvert's ExecutePreprocessor.
nbconvert           6.0.7         Converting Jupyter Notebooks
nbformat            5.0.8         The Jupyter Notebook format
nest-asyncio        1.4.1         Patch asyncio to allow nested event loops
nodeenv             1.5.0         Node.js virtual environment builder
notebook            6.1.4         A web-based notebook environment for interactive computing
numpy               1.19.2        NumPy is the fundamental package for array computing with Python.
overrides           3.1.0         A decorator to automatically detect mismatch when overriding a method.
packaging           20.4          Core utilities for Python packages
pandas              1.1.3         Powerful data structures for data analysis, time series, and statistics
pandocfilters       1.4.2         Utilities for writing pandoc filters in python
parso               0.7.1         A Python Parser
pickleshare         0.7.5         Tiny 'shelve'-like database with concurrency support
pluggy              0.13.1        plugin and hook calling mechanisms for python
pre-commit          2.7.1         A framework for managing and maintaining multi-language pre-commit hooks.
prometheus-client   0.8.0         Python client for the Prometheus monitoring system.
prompt-toolkit      3.0.8         Library for building powerful interactive command lines in Python
py                  1.9.0         library with cross-python path, ini-parsing, io, code, log facilities
pycodestyle         2.6.0         Python style guide checker
pycparser           2.20          C parser in Python
pyflakes            2.2.0         passive checker of Python programs
pygments            2.7.1         Pygments is a syntax highlighting package written in Python.
pyparsing           2.4.7         Python parsing module
pyrsistent          0.17.3        Persistent/Functional/Immutable data structures
pytest              6.1.1         pytest: simple powerful testing with Python
python-dateutil     2.8.1         Extensions to the standard Python datetime module
pytz                2020.1        World timezone definitions, modern and historical
pywin32             228           Python for Window Extensions
pywinpty            0.5.7         Python bindings for the winpty library
pyyaml              5.3.1         YAML parser and emitter for Python
pyzmq               19.0.2        Python bindings for 0MQ
qtconsole           4.7.7         Jupyter Qt console
qtpy                1.9.0         Provides an abstraction layer on top of the various Qt bindings (PyQt5, PyQt4 and...
send2trash          1.5.0         Send file to trash natively under Mac OS X, Windows and Linux.
six                 1.15.0        Python 2 and 3 compatibility utilities
sqlalchemy          1.3.20        Database Abstraction Library
terminado           0.9.1         Tornado websocket backend for the Xterm.js Javascript terminal emulator library.
testpath            0.4.4         Test utilities for code working with files and commands
toml                0.10.1        Python Library for Tom's Obvious, Minimal Language
tornado             6.0.4         Tornado is a Python web framework and asynchronous networking library, originally...
traitlets           5.0.5         Traitlets Python configuration system
typed-ast           1.4.1         a fork of Python 2 and 3 ast modules with type comment support
typing-extensions   3.7.4.3       Backported and Experimental Type Hints for Python 3.5+
virtualenv          20.0.35       Virtual Python Environment builder
wcwidth             0.2.5         Measures the displayed width of unicode strings in a terminal
webencodings        0.5.1         Character encoding aliases for legacy web content
widgetsnbextension  3.5.1         IPython HTML widgets for Jupyter

Before this issue started, in order to launch VS Code and have it find the jupyter kernel I would need to first launch the poetry shell and then open code from the root of my project repo:

# from root folder of project
$ poetry shell
$ code .

Now when VS Code starts up, in the python logs I immediately get some new errors I don't remember seeing before:

User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaa'
> conda --version
> pyenv root
> python3.7 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
Error 2020-10-22 10:11:13: Detection of Python Interpreter for Command py and args -3.6 failed as file Python 3.6 not found!

 (venv)
  -3.8-64 does not exist
  Error 2020-10-22 10:11:13: Detection of Python Interpreter for Command py and args -3.7 failed as file Python 3.7 not found!

   (venv)
    -3.8-64 does not exist
    Error 2020-10-22 10:11:13: Detection of Python Interpreter for Command py and args -2 failed as file Python 2 not found!

     (venv)
      -3.8-64 does not exist
      Starting Jedi Python language engine.
      Python interpreter path: ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe
      > conda --version
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py site --user-site
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py site --user-site
      cwd: c:\Users\eli\projects\ds
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\completion.py
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\completion.py
      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py jupyter kernelspec --version
      Error 2020-10-22 10:11:15: stderr jediProxy Error (stderr) c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\completion.py:584: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
        jedi.api.names(

        > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
        Error 2020-10-22 10:11:17: stderr jediProxy Error (stderr) c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\completion.py:584: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
          jedi.api.names(

          Error 2020-10-22 10:11:17: stderr jediProxy Error (stderr) c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\completion.py:584: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
            jedi.api.names(

And when I attempt to run code in an interactive window, I receive the "Timed out waiting to get a heartbeat from kernel process." error, with the following python log output:

> ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\normalizeForInterpreter.py "from pathlib import Path"
> ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
Error 2020-10-22 10:24:00: Jupyter Kernel Spec not found for a local connection
> ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
Error 2020-10-22 10:24:00: Kernel died [r [Error]: Kernel died with exit code 1. 
  at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664773
    at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
      at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
        at Immediate.<anonymous> (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
          at processImmediate (internal/timers.js:439:21)] {
            exitCode: 1,
              reason: ''
              } 
              Error 2020-10-22 10:24:00: KernelProcess Exit Exit - 1,  [r [Error]: Kernel died with exit code 1. 
                at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664773
                  at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
                    at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
                      at Immediate.<anonymous> (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
                        at processImmediate (internal/timers.js:439:21)] {
                          exitCode: 1,
                            reason: ''
                            }
                            > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
                            Error 2020-10-22 10:24:10: Timed out waiting to get a heartbeat from kernel process.
                            Error 2020-10-22 10:24:10: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
                            Error 2020-10-22 10:24:10: Failed to initialize S [Error: Timed out waiting to get a heartbeat from kernel process.
                              at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                              Error 2020-10-22 10:24:10: Failed to initialize ipywidgetHandler [Error: Timed out waiting to get a heartbeat from kernel process.
                                at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                Error 2020-10-22 10:24:10: Failed to initialize ipywidgetHandler [Error: Timed out waiting to get a heartbeat from kernel process.
                                  at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                  Error 2020-10-22 10:24:10: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                    at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                    > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
                                    Error 2020-10-22 10:24:11: Jupyter Kernel Spec not found for a local connection
                                    > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
                                    Error 2020-10-22 10:24:11: Kernel died [r [Error]: Kernel died with exit code 1. 
                                      at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664773
                                        at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
                                          at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
                                            at Immediate.<anonymous> (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
                                              at processImmediate (internal/timers.js:439:21)] {
                                                exitCode: 1,
                                                  reason: ''
                                                  } 
                                                  Error 2020-10-22 10:24:11: KernelProcess Exit Exit - 1,  [r [Error]: Kernel died with exit code 1. 
                                                    at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664773
                                                      at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
                                                        at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
                                                          at Immediate.<anonymous> (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
                                                            at processImmediate (internal/timers.js:439:21)] {
                                                              exitCode: 1,
                                                                reason: ''
                                                                }
                                                                > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
                                                                Error 2020-10-22 10:24:30: Timed out waiting to get a heartbeat from kernel process.
                                                                Error 2020-10-22 10:24:30: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
                                                                Error 2020-10-22 10:24:30: Failed to initialize S [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                  at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                  Error 2020-10-22 10:24:30: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                    at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                    > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
                                                                    Error 2020-10-22 10:24:31: stderr jediProxy Error (stderr) c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\completion.py:584: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
                                                                      jedi.api.names(

                                                                      Error 2020-10-22 10:24:31: Jupyter Kernel Spec not found for a local connection
                                                                      > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
                                                                      Error 2020-10-22 10:24:31: Kernel died [r [Error]: Kernel died with exit code 1. 
                                                                        at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664773
                                                                          at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
                                                                            at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
                                                                              at Immediate.<anonymous> (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
                                                                                at processImmediate (internal/timers.js:439:21)] {
                                                                                  exitCode: 1,
                                                                                    reason: ''
                                                                                    } 
                                                                                    Error 2020-10-22 10:24:31: KernelProcess Exit Exit - 1,  [r [Error]: Kernel died with exit code 1. 
                                                                                      at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664773
                                                                                        at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
                                                                                          at c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
                                                                                            at Immediate.<anonymous> (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
                                                                                              at processImmediate (internal/timers.js:439:21)] {
                                                                                                exitCode: 1,
                                                                                                  reason: ''
                                                                                                  }
                                                                                                  > ~\AppData\Local\pypoetry\Cache\virtualenvs\ds-QB9ZX51Q-py3.8\Scripts\python.exe c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
                                                                                                  Error 2020-10-22 10:24:41: Timed out waiting to get a heartbeat from kernel process.
                                                                                                  Error 2020-10-22 10:24:41: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                  Error 2020-10-22 10:24:41: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                    at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                                                    Error 2020-10-22 10:24:41: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                      at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                                                      Error 2020-10-22 10:24:41: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                        at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                                                        Error 2020-10-22 10:25:01: Timed out waiting to get a heartbeat from kernel process.
                                                                                                        Error 2020-10-22 10:25:01: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                        Error 2020-10-22 10:25:01: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                          at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                                                          Error 2020-10-22 10:25:01: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                            at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]
                                                                                                            Error 2020-10-22 10:25:01: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
                                                                                                              at f.waitForHeartbeat (c:\Users\eli\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)]

I have tried rolling back to older versions of the python extension as well as VS Code, but to no avail. This all used to work fine last week.

I saw https://github.com/microsoft/vscode-python/issues/14118 posted with the same error, but that was due to a space in the username, which is not the case for me.

I also saw https://github.com/microsoft/vscode-python/issues/13365 posted with the same error, in which it was claimed that this issue should only affect users with Windows + Python 3.8 + ipykernel < 5.1.4, but I have a higher version of ipykernel and am still getting this issue.

Thanks in advance for your help and for making this fantastic IDE!

elicutler commented 4 years ago

After totally removing my virtual environment and then re-installing it via poetry, this issue has gone away. I still don't know what exactly happened, but I will close this out.

matthoendorf commented 4 years ago

I'm having this same issue using Poetry on Windows 10. It was working until I updated one of the libraries in my environment.

I also tried rolling back the Python extension as well as reinstalling ipykernel and restarting my machine. As @elicutler noted, after totally removing my virtual environment and then re-installing it via poetry, this issue has gone away.

Environment details:

$ code --version
1.50.1
d2e414d9e4239a252d1ab117bd7067f125afd80a
x64
# python extension version: 2020.9.114305
$ python -V
Python 3.7.8

$ poetry --version
Poetry version 1.1.3

$ poetry show
adal                     1.2.4                                              Note: This library is already replaced by MSAL Python, available here: https://pypi.org/project/msal/ .ADAL Python remains available here as a legacy. The ADAL for Python libr...
addict                   2.3.0                                              Addict is a dictionary whose items can be set using both attribute and item syntax.
aiofiles                 0.5.0                                              File support for asyncio.
async-generator          1.10                                               Async generators and context managers for Python 3.5+
attrs                    20.2.0                                             Classes Without Boilerplate
backcall                 0.2.0                                              Specifications for callback functions passed in to an API
bcrypt                   3.2.0                                              Modern password hashing for your software and your servers
bleach                   3.2.1                                              An easy safelist-based HTML-sanitizing tool.
boto3                    1.16.1                                             The AWS SDK for Python
botocore                 1.19.1                                             Low-level, data-driven core of boto 3.
cachetools               4.1.1                                              Extensible memoizing collections and decorators
certifi                  2020.6.20                                          Python package for providing Mozilla's CA Bundle.
cffi                     1.14.3                                             Foreign Function Interface for Python calling C code.
chardet                  3.0.4                                              Universal encoding detector for Python 2 and 3
click                    7.1.2                                              Composable command line interface toolkit
colorama                 0.4.4                                              Cross-platform colored terminal text.
cryptography             3.1.1                                              cryptography is a package which provides cryptographic recipes and primitives to Python developers.
decorator                4.4.2                                              Decorators for Humans
defusedxml               0.6.0                                              XML bomb protection for Python stdlib modules
demjson                  2.2.4                                              encoder, decoder, and lint/validator for JSON (JavaScript Object Notation) compliant with RFC 7159 
entrypoints              0.3                                                Discover and load entry points from installed packages.
fastjsonschema           2.14.5                                             Fastest Python implementation of JSON schema
ftfy                     5.5.1                                              Fixes some problems with Unicode text after the fact
fuzzywuzzy               0.18.0                                             Fuzzy string matching in python
google-api-core          1.23.0                                             Google API client core library
google-auth              1.22.1                                             Google Authentication Library
google-cloud-core        1.4.3                                              Google Cloud API client core library
google-cloud-translate   3.0.1                                              Google Cloud Translation API client library
googleapis-common-protos 1.52.0                                             Common protobufs used in Google APIs
grpcio                   1.32.0                                             HTTP/2-based RPC framework
h11                      0.11.0                                             A pure-Python, bring-your-own-I/O implementation of HTTP/1.1
httpcore                 0.12.0                                             A minimal low-level HTTP client.
httpx                    0.16.1                                             The next generation HTTP client.
humanize                 0.5.1                                              python humanize utilities
idna                     2.10                                               Internationalized Domain Names in Applications (IDNA)
importlib-metadata       2.0.0                                              Read metadata from Python packages
ipaddress                1.0.23                                             IPv4/IPv6 manipulation library
ipdata                   3.2                                                Python Client for the ipdata IP Geolocation API
ipykernel                5.3.4                                              IPython Kernel for Jupyter
ipython                  7.18.1                                             IPython: Productive Interactive Computing
ipython-genutils         0.2.0                                              Vestigial utilities from IPython
itsdangerous             1.1.0                                              Various helpers to pass data to untrusted environments and back.
jedi                     0.17.2                                             An autocompletion tool for Python that can be used for text editors.
jinja2                   2.11.2                                             A very fast and expressive template engine.
jmespath                 0.10.0                                             JSON Matching Expressions
jsonschema               3.2.0                                              An implementation of JSON Schema validation for Python
jupyter-client           6.1.7                                              Jupyter protocol implementation and client libraries
jupyter-core             4.6.3                                              Jupyter core package. A base package on which Jupyter projects rely.
jupyterlab-pygments      0.1.2                                              Pygments theme using JupyterLab CSS variables
libcst                   0.3.13                                             A concrete syntax tree with AST-like properties for Python 3.5, 3.6, 3.7 and 3.8 programs.
lxml                     4.6.1                                              Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
markupsafe               1.1.1                                              Safely add untrusted strings to HTML/XML markup.
mistune                  0.8.4                                              The fastest markdown parser in pure Python
mypy-extensions          0.4.3                                              Experimental type system extensions for programs checked with the mypy typechecker.
nbclient                 0.5.1                                              A client library for executing notebooks. Formerly nbconvert's ExecutePreprocessor.
nbconvert                6.0.7                                              Converting Jupyter Notebooks
nbformat                 5.0.8                                              The Jupyter Notebook format
nest-asyncio             1.4.1                                              Patch asyncio to allow nested event loops
nostril                  1.2.0 fbc0c91                                      Nonsense String Evaluator
numpy                    1.14.5                                             NumPy: array processing for numbers, strings, records, and objects.
packaging                20.4                                               Core utilities for Python packages
pandas                   0.25.3                                             Powerful data structures for data analysis, time series, and statistics
pandocfilters            1.4.2                                              Utilities for writing pandoc filters in python
paramiko                 2.7.2                                              SSH2 protocol library
parso                    0.7.1                                              A Python Parser
pathtools                0.1.2                                              File system general utilities
pickleshare              0.7.5                                              Tiny 'shelve'-like database with concurrency support
pillow                   8.0.0                                              Python Imaging Library (Fork)
plac                     0.9.1                                              The smartest command line arguments parser in the world
prettytable              1.0.1                                              A simple Python library for easily displaying tabular data in a visually appealing ASCII table format
prompt-toolkit           3.0.8                                              Library for building powerful interactive command lines in Python
proto-plus               1.11.0                                             Beautiful, Pythonic protocol buffers.
protobuf                 3.13.0                                             Protocol Buffers
psycopg2                 2.8.6                                              psycopg2 - Python-PostgreSQL Database Adapter
py                       1.9.0                                              library with cross-python path, ini-parsing, io, code, log facilities
pyasn1                   0.4.8                                              ASN.1 types and codecs
pyasn1-modules           0.2.8                                              A collection of ASN.1-based protocols modules.
pycparser                2.20                                               C parser in Python
pygments                 2.7.1                                              Pygments is a syntax highlighting package written in Python.
pyjwt                    1.7.1                                              JSON Web Token implementation in Python
pymysql                  0.10.1                                             Pure Python MySQL Driver
pynacl                   1.4.0                                              Python binding to the Networking and Cryptography (NaCl) library
pyparsing                2.4.7                                              Python parsing module
pyreadstat               1.0.2                                              Reads and Writes SAS, SPSS and Stata files into/from pandas data frames.
pyrsistent               0.17.3                                             Persistent/Functional/Immutable data structures
pytest                   3.0.5                                              pytest: simple powerful testing with Python
python-dateutil          2.8.1                                              Extensions to the standard Python datetime module
python-dotenv            0.14.0                                             Add .env support to your django/flask apps in development and deployments
python-pptx              0.6.18                                             Generate and manipulate Open XML PowerPoint (.pptx) files
pytz                     2020.1                                             World timezone definitions, modern and historical
pywin32                  228                                                Python for Window Extensions
pyyaml                   5.3.1                                              YAML parser and emitter for Python
pyzmq                    19.0.2                                             Python bindings for 0MQ
quantipy3                0.2.2
requests                 2.24.0                                             Python HTTP for Humans.
rfc3986                  1.4.0                                              Validating URI References per RFC 3986
riverutils               1.0.2 riverutils/riverutils-1.0.2-py3-none-any.whl River Utilities
rsa                      4.6                                                Pure-Python RSA implementation
s3transfer               0.3.3                                              An Amazon S3 Transfer Manager
savreaderwriter          3.4.2                                              Read and write SPSS files
scipy                    1.2.1                                              SciPy: Scientific Library for Python
six                      1.15.0                                             Python 2 and 3 compatibility utilities
sniffio                  1.2.0                                              Sniff out which async library your code is running under
sqlalchemy               1.3.20                                             Database Abstraction Library
sshtunnel                0.1.5                                              Pure python SSH tunnels
starlette                0.13.8                                             The little ASGI library that shines.
tabulate                 0.7.7                                              Pretty-print tabular data
testpath                 0.4.4                                              Test utilities for code working with files and commands
tornado                  6.0.4                                              Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
traitlets                5.0.5                                              Traitlets Python configuration system
typing-extensions        3.7.4.3                                            Backported and Experimental Type Hints for Python 3.5+
typing-inspect           0.6.0                                              Runtime inspection utilities for typing module.
urllib3                  1.25.11                                            HTTP library with thread-safe connection pooling, file post, and more.
uvicorn                  0.12.2                                             The lightning-fast ASGI server.
watchdog                 0.10.3                                             Filesystem events monitoring
watchgod                 0.6                                                Simple, modern file watching and code reload in python.
wcwidth                  0.2.5                                              Measures the displayed width of unicode strings in a terminal
webencodings             0.5.1                                              Character encoding aliases for legacy web content
websockets               8.1                                                An implementation of the WebSocket Protocol (RFC 6455 & 7692)
xlsxwriter               1.3.7                                              A Python module for creating Excel XLSX files.
xmltodict                0.12.0                                             Makes working with XML feel like you are working with JSON
zipp                     3.3.1                                              Backport of pathlib-compatible object wrapper for zip files

Debug Console:

Error 2020-10-23 17:29:09: Jupyter Kernel Spec not found for a local connection
> ~\AppData\Local\pypoetry\Cache\virtualenvs\analysis-hub-_PmRVjjH-py3.7\Scripts\python.exe c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
> ~\AppData\Local\pypoetry\Cache\virtualenvs\analysis-hub-_PmRVjjH-py3.7\Scripts\python.exe c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
> ~\AppData\Local\pypoetry\Cache\virtualenvs\analysis-hub-_PmRVjjH-py3.7\Scripts\python.exe c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\AppData\Local\pypoetry\Cache\virtualenvs\analysis-hub-_PmRVjjH-py3.7\Scripts\python.exe c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~\Anaconda3\Scripts\conda.exe info --json
> ~\Anaconda3\Scripts\conda.exe env list
> ~\AppData\Local\pypoetry\Cache\virtualenvs\analysis-hub-_PmRVjjH-py3.7\Scripts\python.exe c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Error 2020-10-23 17:29:13: Kernel died r [Error]: Traceback (most recent call last):

    at t._next (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:54:664931)
    at t.__tryOrUnsub (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:24:5463)
    at t.next (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:24:4632)
    at t._next (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:24:3736)
    at t.next (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:24:3407)
    at t.next (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:24:8976)
    at c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:9:60009
    at c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362324
    at c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:362542
    at Immediate._onImmediate (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:47:364107)
    at processImmediate (internal/timers.js:439:21) 
Error 2020-10-23 17:29:41: Timed out waiting to get a heartbeat from kernel process.
Error 2020-10-23 17:29:41: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
Error 2020-10-23 17:29:41: Failed to determine if a notebook is active for the current editor Error: Timed out waiting to get a heartbeat from kernel process.
    at f.waitForHeartbeat (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)
Error 2020-10-23 17:29:41: Failed to determine if a notebook is active for the current editor Error: Timed out waiting to get a heartbeat from kernel process.
    at f.waitForHeartbeat (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)
Error 2020-10-23 17:29:41: Failed to initialize S Error: Timed out waiting to get a heartbeat from kernel process.
    at f.waitForHeartbeat (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)
Error 2020-10-23 17:29:41: DataScience Error Error: Timed out waiting to get a heartbeat from kernel process.
    at f.waitForHeartbeat (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)
Error 2020-10-23 17:29:41: DataScience Error Error: Timed out waiting to get a heartbeat from kernel process.
    at f.waitForHeartbeat (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)
Error 2020-10-23 17:29:41: Failed to initialize ipywidgetHandler Error: Timed out waiting to get a heartbeat from kernel process.
    at f.waitForHeartbeat (c:\Users\mhoendorf\.vscode\extensions\ms-python.python-2020.9.114305\out\client\extension.js:56:574362)