spyder: TimeoutError when running cells after a kernel restart

Full traceback below; cell runs fine via highlight + “Run selection or current line”; behavior’s fixed upon restarting kernel, but returns randomly after finishing a TensorFlow training session (didn’t test in other settings).

Traceback (most recent call last):

  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\comms\commbase.py", line 542, in __call__
    call_dict, call_data, self._comm_id)
  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\comms\commbase.py", line 415, in _get_call_return_value
    self._wait_reply(call_id, call_name, timeout)
  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\comms\frontendcomm.py", line 161, in _wait_reply
    call_name))

TimeoutError: Timeout while waiting for 'run_cell' reply

Update: reproduced immediately after restarting kernel and working with basic numpy operations


Update 2: interrupting frozen run-cell command yields below:

Traceback (most recent call last):

  File "<ipython-input-4-633e420a5051>", line 1, in <module>
    runcell('[], #5', 'C:/DL_code/dev_ensemble_subset.py')
  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 539, in runcell
    cell_code = frontend_request().run_cell(cellname, filename)
  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\comms\commbase.py", line 542, in __call__
    call_dict, call_data, self._comm_id)
  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\comms\commbase.py", line 415, in _get_call_return_value
    self._wait_reply(call_id, call_name, timeout)
  File "D:\Anaconda\envs\s4_env\lib\site-packages\spyder_kernels\comms\frontendcomm.py", line 167, in _wait_reply
    time.sleep(0.01)

KeyboardInterrupt

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (16 by maintainers)

Most upvoted comments

I can’t reproduce on mac. A workaroud could be to select this in the settings: Screenshot 2019-12-28 at 17 21 12

This will be fixed in Spyder 4.1, to be released in a couple of months. In the meantime, please switch to the old way of evaluating cells, as described here:

https://stackoverflow.com/a/59494870/438386