vscode-jupyter: Notebook cell gets stuck in 'Pending' state
Applies To
- Notebooks (.ipynb files)
- Interactive Window and/or Cell Scripts (.py files with #%% markers)
What happened?
When I start a notebook with ‘Run all’ and I have to kill the kernel for some reason with the kill command from the terminal the notebook cells that haven’t been executed can get stuck in the ‘Pending’ state (little clock icon). Even if I close the notebook and reopen it, I cannot execute these pending cells anymore unless I convert them to a markdown cell and back. It would be great if the pending flag was reset when the kernel dies or otherwise killed without using the vscode ‘Interrupt’ and ‘Restart’ buttons. I have to restart vscode for the ‘Pending’ flags to go away. This is a vscode issue, the underlying kernel runs just fine.
No entry in the Jupyter log when I try to execute a cell marked as pending, so apparently vscode doesn’t even attempt to execute that cell.
VS Code Version
Version: 1.77.3 (system setup) Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710 Date: 2023-04-12T09:16:02.548Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Windows_NT x64 10.0.19045 Sandboxed: No
Jupyter Extension Version
v2023.3.1201040234
Jupyter logs
--
Coding Language and Runtime Version
No response
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Remote
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 8
- Comments: 58 (23 by maintainers)
I am also having the exact same problem.
Me too!
Facing the very same issue. I have to reload VSC to make it work. After some time, it’s starts showing “Pending” status to cell again. It’s so frustrating specially when you’re working with huge data. After loading the data, at some point, it starts doing again and I have to reload the VSC again. Not only that, sometimes its IntelliSense stops working too
This happens for me when debugging cells:
Had the same issue here, ended up realizing that the problem came from Pylance: https://github.com/microsoft/pylance-release/issues/5019
To solve it downgrade the Pylance of Vscode to 2023.10.4 Seems to work for now.
Same problem with the execution of n cell with local jupyter kernel after today’s upgrade to
Version: 1.79.2 (system setup) Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:57:04.379Z Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045
ipykernel == 6.21.2 Python == 3.9.7
In terminal ipython the same code works fine.
The execution of every next cell get stuck with long Pending cell status (min. 10 seconds for eg. declare an empty list) always after run a cell that contains the following code:
No, I only have extensions
Python, Jupyter, GitHub Copliot, Pylance
. Now, I thinkPylance
maybe is the reason.I am trying to do this. Report you later.
No, I didn’t do any operation of them. I think it may caused by pylance. I will try to disable pylance extention and continue my work. If that is true or not true, I will report at there soon.
Same problem
The debug I said is just I am revising my code in the jupyter cell.
Still having this issue. Can’t run a single notebook cell. Even when I quit VSCode and restart.
me too… still i don’t know why