Error when running Python in Visual Studio Code: Error: Session cannot generate requests

  Uncategorised

I am using a virtual maching provided by AWS, to which I connect via its ssh key using VSC. When connected to it, I open a jupyter notebook inside the VM (via VSC) in which I run my code.

Today I wanted to execute a particular cell, and I noticed that some points during its execution (it takes ~24mins), and after a while, before it has ended all the other cells that wait for execution get "canceled" and the following message appears below them.

enter image description here

I have no idea what this error means. I’ve already executed another notebook which run for 4-5 hours without issues.

If you need any other information please ask me. Thanks in advance.

Source: Visual Studio Questions

2 thoughts on - Error when running Python in Visual Studio Code: Error: Session cannot generate requests

  • I am running into the same issue. It’s not just liimted to in VS Code. the ipython kernel seems to die for no obvious reasons and we get this error
    Error: Session cannot generate requests
    at S.executeCodeCell (/home/cyy/.vscode-server/extensions/ms-toolsai.jupyter-2021.10.1001414422/out/client/extension.js:66:301742)
    at S.execute (/home/cyy/.vscode-server/extensions/ms-toolsai.jupyter-2021.10.1001414422/out/client/extension.js:66:300732)
    at S.start (/home/cyy/.vscode-server/extensions/ms-toolsai.jupyter-2021.10.1001414422/out/client/extension.js:66:296408)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async t.CellExecutionQueue.executeQueuedCells (/home/cyy/.vscode-server/extensions/ms-toolsai.jupyter-2021.10.1001414422/out/client/extension.js:66:312326)
    at async t.CellExecutionQueue.start (/home/cyy/.vscode-server/extensions/ms-toolsai.jupyter-2021.10.1001414422/out/client/extension.js:66:311862)

LEAVE A COMMENT