Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Debugger can't be enabled with ipykernel (6.5.1) #598

Open
JTL0506 opened this issue Dec 2, 2021 · 2 comments
Open

Debugger can't be enabled with ipykernel (6.5.1) #598

JTL0506 opened this issue Dec 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@JTL0506
Copy link

JTL0506 commented Dec 2, 2021

Description

I read in the documentation that debugging using the ipykernel should now be possible starting jupyterlab version 3.
I have currently installed jupyterlab (3.2.4) and ipykernel (6.5.1) but the debugging toggle is not active.
image

However, debugging works with the xeus-python kernel.

Reproduce

This is the case in a fresh conda environment.

@JTL0506 JTL0506 added the bug Something isn't working label Dec 2, 2021
@welcome
Copy link

welcome bot commented Dec 2, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@kycutler
Copy link

I have seen this caused by the wrong kernelspec getting picked up (also using Anaconda).

If you run jupyter --paths you should see a few directories listed under the data: heading. These are where kernelspecs are searched for.

If you open each directory in order and check the kernel subdirectory for python3, the first one you find should be the one that Jupyter server is finding as well. If the kernel.json inside there doesn't have the metadata.debugger = true key as in the example below, that explains why it isn't enabled in JLab. There are a few ways to resolve this:

  • Simply add the missing debugger key. However, depending on your setup this may cause problems when switching between Anaconda environments if the targeted ipykernel version doesn't support debugging.
  • If there is another instance of the python3 kernel directory later on that does have the key, you can rename the first (or second) python3 directory to avoid the collision so that both are accessible. You can also change the display_name to help you determine which is which.

Here's the content of one of my debuggable kernel.json files for reference:

{
 "argv": [
  "python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3 (ipykernel)",
 "language": "python",
 "metadata": {
  "debugger": true
 }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants