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.
Answer from Mr Jxtr on Stack OverflowTrust me, learn about virtual environments, how they work, and why they are used. You will save yourself a lot of headaches in the future.
Jupyter cell pending forever
All cells get stuck pending after specific cell is run
python - Jupyter Notebook in VS Code Keeps Running Without Completing Execution - Stack Overflow
Interactive Window cells stuck in “Pending” after full script execution
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.

