You probably are in the wrong kernel or Python venv.

If you are not sure what is a venv and how to create them, refer to this documentation.

Make sure to always check here which venv you are in.

It is always recommended to use venv instead of using your Python in PATH.

Examples below show python installations in PATH (DO NOT USE THIS)

Create a new venv in the directory of your project then use that venve to run your notebook. documentation

It should look something like this: (venv)

In the example above, I have a data-proj-venv using Python 3.12.5 which I use when working on data science projects.

Trust me, learn about virtual environments, how they work, and why they are used. You will save yourself a lot of headaches in the future.

Answer from Mr Jxtr on Stack Overflow
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 13349
Notebook cell gets stuck in 'Pending' state · Issue #13349 · microsoft/vscode-jupyter
April 18, 2023 - 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.
Author   dobos
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 16352
Jupyter Notebook cells pending and failing to execute · Issue #16352 · microsoft/vscode-jupyter
January 2, 2025 - Type: Bug I try to run all cells in my jupyter notebook but it simply is stuck on pending/does not execute. I have tried various fixes like switching to pre-release version of Jupyter and restartin...
Author   tasminc
Discussions

Jupyter cell pending forever
Applies To Notebooks (.ipynb files) Interactive Window and/or Cell Scripts (.py files with #%% markers) What happened? I've recently experienced cell execution pending forever, with no modifica... More on github.com
🌐 github.com
2
January 22, 2024
All cells get stuck pending after specific cell is run
In order to continue working, I need to completely exit VScode and restart it. Interrupting the kernel is insufficient. I am able to reproduce this every time but it is specific to my data and query from what I can tell, so it's hard to share a repro. If I run this same cell in a standard Jupyter notebook ... More on github.com
🌐 github.com
6
February 28, 2025
python - Jupyter Notebook in VS Code Keeps Running Without Completing Execution - Stack Overflow
I'm using Visual Studio Code with Python installed, and I'm encountering an issue where Jupyter notebooks are not running properly. When I execute a cell in the Jupyter notebook in VS Code, it starts More on stackoverflow.com
🌐 stackoverflow.com
Interactive Window cells stuck in “Pending” after full script execution
Applies To Notebooks (.ipynb files) Interactive Window and/or Cell Scripts (.py files with #%% markers) What happened? I am experiencing an issue when using the Interactive Window with a .py script. The script runs completely fine the fi... More on github.com
🌐 github.com
19
November 13, 2025
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 17271
Jupyter Interactive Window stuck in pending due to _VSCODE_getVariable request · Issue #17271 · microsoft/vscode-jupyter
January 21, 2026 - Applies To Notebooks (.ipynb files) Interactive Window and/or Cell Scripts (.py files with #%% markers) What happened? The Interactive Window gets stuck in "pending" when the jupyter variables view is unable to retrieve variable values. ...
Author   flori-ko
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 15051
Jupyter cell pending forever · Issue #15051 · microsoft/vscode-jupyter
January 22, 2024 - Applies To Notebooks (.ipynb files) Interactive Window and/or Cell Scripts (.py files with #%% markers) What happened? I've recently experienced cell execution pending forever, with no modification from my side on the Jupyter extension o...
Author   Pierre-LaurentC
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 16466
All cells get stuck pending after specific cell is run · Issue #16466 · microsoft/vscode-jupyter
February 28, 2025 - In order to continue working, I need to completely exit VScode and restart it. Interrupting the kernel is insufficient. I am able to reproduce this every time but it is specific to my data and query from what I can tell, so it's hard to share a repro. If I run this same cell in a standard Jupyter notebook environment, this issue does not occur.
Author   travisgroth
🌐
Visual Studio Code
code.visualstudio.com › docs › datascience › jupyter-notebooks
Jupyter Notebooks in VS Code
November 3, 2021 - If you attempt to open a notebook when VS Code is in an untrusted workspace running Restricted Mode, you will not be able to execute cells and rich outputs will be hidden. You can create a Jupyter Notebook by running the Create: New Jupyter Notebook command from the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) or by creating a new .ipynb file in your workspace.
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 17148
Interactive Window cells stuck in “Pending” after full script execution · Issue #17148 · microsoft/vscode-jupyter
November 13, 2025 - -Run the entire script using "Run Python File in Interactive Window". -Wait for the script to finish (it completes successfully). -Attempt to run any individual cell afterwards. -The cell remains stuck in the “Pending” state forever. -The Jupyter log shows the message "Cell Index:4 sent to kernel"
Author   tamvejarf
Find elsewhere
🌐
Reddit
reddit.com › r/vscode › jupyter cells hang on execution.
r/vscode on Reddit: Jupyter cells hang on execution.
January 15, 2022 -

Hi,

I'm having a weird problem where execution of Python code cells in the Jupyter notebook hangs constantly (maybe every second attempt causes a hang). Weirdly, the code execution continues if I click on "Jupyter: Variables" on the bottom console display.

I get a complaint "qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in """ when starting the console. Not sure if it's related.

This happens both on Insiders and regular build. VSCode is 1.63.2 running on Ubuntu 21.10.

🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 15840
Running cell in Interactive Window gets stuck on "Pending" · Issue #15840 · microsoft/vscode-jupyter
July 10, 2024 - Jupyter › Interactive Window: Creation Mode is set to Multiple · Code should run immediately. SOMETIMES (this behavior is very inconsistent), the cell gets stuck on "Pending" for some period of time before executing.
Author   goldrik
🌐
Julia Programming Language
discourse.julialang.org › new to julia
Notebook cells hung up in VS Code - New to Julia - Julia Programming Language
March 25, 2022 - I’m just getting started with Julia in VS Code, and I’m running into an issue where notebook cells run for hours with the progress wheels spinning. Even this simple calculation seems to be too much for my computer to han…
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 14716
Jupyter Notebook cells hang forever in VSCode · Issue #14716 · microsoft/vscode-jupyter
November 14, 2023 - Update VSCode jupyter notebooks work locally. It is an issue on the remote server. Environment data VS Code version: 1.84.2 Jupyter Extension version (available under the Extensions sidebar): v2023...
Author   marcoBmota8
🌐
Errorism
errorism.dev › issues › microsoft-vscode-jupyter-notebook-cell-gets-stuck-in-pending-state
vscode-jupyter: Notebook cell gets stuck in 'Pending' state
To solve it downgrade the Pylance of Vscode to 2023.10.4 Seems to work for now. ... 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 ...
🌐
Stack Overflow
stackoverflow.com › questions › 69802911 › vscode-hangs-when-trying-to-run-a-jupyter-notebook
visual studio code - VSCode hangs when trying to run a Jupyter notebook? - Stack Overflow
I am trying to run a Jupyter notebook in VSCode. I have successfully run notebooks in the past, but something has happened to make VSCode "hang" when I try running. When I hit run, the terminal shows the file location and the location of python.exe as expected (shown in the first image, with some personal information redacted), but nothing ever happens. The code never completes and the cells never output. I get a small "pending" icon of a clock and an arrow (shown in the second image) to tell me a cell is running, but even the most basic "Hello, world" never completes or gives an error.
🌐
GitHub
github.com › microsoft › vscode › issues › 142466
jupyter notebook cell pending indicator missing · Issue #142466 · microsoft/vscode
February 7, 2022 - Issue Type: Bug When a Jupyter notebook cell is pending the completion of other cells, the UI used to show a pending indicator in the bottom left corner of the cell. This is visible in screen shots in the online documentation as well. Ho...
Published   Feb 07, 2022
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1499568 › vs-code-cant-run-cells-it-stuck-and-running-infini
VS Code can't run cells. It stuck and running infinitely (kernel: python 3.11.2 ) - Microsoft Q&A
January 17, 2024 - After trying to install a library (I don't remember what) and restart VS Code before finished it ('cause the installation took more time than I supposed), the cells in my Jupyter notebook started to run but without any further result. It took a long…