Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging Jupyter Notebook cells: "Ipykernel setup required for this feature", but ipykernel is installed #16257

Open
1 of 2 tasks
marcopist opened this issue Nov 29, 2024 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-debugging

Comments

@marcopist
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Steps:

  • Opening any jupyter notebook and clicking debug cell.

Expectation

  • A debugger session launches

Result

  • I get this popup:

Image

Other notes

ipykernel is installed in the virtual environment & kernel used by VS Code.

If I reload the VS Code window the debugger sometimes launches, but only once.

VS Code Version

1.93.1

Jupyter Extension Version

v2024.8.1

Jupyter logs

10:03:27.181 [info] Starting debugging with mode 1
10:03:27.203 [info] Ipykernel check failed: Unknown
10:04:44.070 [info] Starting debugging with mode 1
10:04:44.092 [info] Ipykernel check failed: Unknown

Coding Language and Runtime Version

Python v 3.10

Language Extension Version (if applicable)

v2024.14.1

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

@marcopist marcopist added the bug Issue identified by VS Code Team member as probable bug label Nov 29, 2024
@marcopist marcopist changed the title "Ipykernel setup required for this feature", but ipykernel is installed Debugging Jupyter Notebook cells: "Ipykernel setup required for this feature", but ipykernel is installed Nov 29, 2024
@DonJayamanne
Copy link
Contributor

DonJayamanne commented Dec 3, 2024

Thank you for filing this issue and sorry you are running into this.
You seem to be using an olde version of VS Code and Jupyter extension.
Please can you update all of the related extension (Python, Jupyter) along with VS Code.

Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to trace
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel (use the command Jupyter: Show Output to get to the logs).

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster notebook-debugging labels Dec 3, 2024
@marcopist
Copy link
Author

This is the trace log:

09:50:05.098 [trace] Executing silently Code (idle) = import builtins\nimport ipykernel\nbuiltins.print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d" + ipykernel._
09:50:05.211 [debug] Kernel output 28008: 5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d6.29.55dc3a68c-e34e-4080-9c3e-2a532b2ccb4d

09:50:05.213 [trace] Executing silently Code (completed) = import builtins\nimport ipykernel\nbuiltins.print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d" + ipykernel._ with 0 output(s)
09:50:05.214 [info] Ipykernel check failed: Unknown

@DonJayamanne
Copy link
Contributor

Pleaser can you share the full log
I would like you see the version info, python Env, and other bits as well from the logs

@marcopist
Copy link
Author

Hi - sorry for the delay but I figured out what seems to be causing the issue. One of the libraries I am importing in my jupyter notebook was overriding sys.stdout, causing the debugger to fail starting up and no printing in the notebook. When that sys.stdout override is removed from the library or the library is not imported, the debugger starts up ok.

It's fine to close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-debugging
Projects
None yet
Development

No branches or pull requests

2 participants