Repository navigation
Couldn't debug ipykernel in vscode test or in debug panel #974
Copy link
Copy link
Closed
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
When debug github.com/ipython/ipykernel/pull/1469:
Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=d:\\test\\test', '--capture=no', 'd:\\test\\test\\ipykernel\\tests\\test_debugger.py::test_stop_on_breakpoint']
============================= test session starts =============================
platform win32 -- Python 3.14.0, pytest-9.0.2, pluggy-1.6.0
rootdir: d:\test\test
configfile: ipykernel\pyproject.toml
plugins: flaky-3.8.1, asyncio-1.3.0, cov-7.0.0, timeout-2.4.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
timeout: 30.0s
timeout method: thread
timeout func_only: False
collected 1 item
ipykernel\tests\test_debugger.py 0.02s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
No module named ipykernel_launcher
and also leaves many zombie processes of python and are not cleaned.
When debug release version:
Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=d:\\test\\Newfolder', '--capture=no', 'd:\\test\\Newfolder\\ipykernel\\tests\\test_debugger.py::test_stop_on_breakpoint']
============================= test session starts =============================
platform win32 -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: d:\test\Newfolder
configfile: ipykernel\pyproject.toml
plugins: anyio-4.12.0, asyncio-1.3.0, timeout-2.4.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
timeout: 30.0s
timeout method: thread
timeout func_only: False
collected 1 item
ipykernel\tests\test_debugger.py 0.02s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
c:\Users\user\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy/..\debugpy\_vendored\force_pydevd.py:18: UserWarning: incompatible copy of pydevd already imported:
c:\pixi\.pixi\envs\default\Lib\site-packages\pydevd_plugins\extensions\pydevd_plugin_omegaconf.py
warnings.warn(msg + ':\n {}'.format('\n '.join(_unvendored)))
then hang forever.
but the "test" button has no issue, however, the "debug test" has these issues. So the ipykernel and its tests, seem to have no problem themselvies.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
rchiodo commentedon Mar 9, 2026
I believe this is the reason here:
Are you using pydevd internally? You can't load a different version that the debugger ships with.
NewUserHa commentedon Mar 10, 2026
no, it was debugging ipykernel.
There are two issues, 2nd. pydevd. 1st. No module named ipykernel_launcher
the 1. No module named ipykernel_launcher is:
the test itself can run through, but the "debug test" button stuck at there. "So the ipykernel and its tests, seem to have no problem themselvies.", so this may be a problem on "vscode debugger" side or "vscode test" side, I guess
NewUserHa commentedon Mar 10, 2026
for the 2. pydevd might be related to https://github.com/ipython/ipykernel/blob/770afbeb76a5dd4e752cf9547deeaa0651c40f63/ipykernel/debugger.py#L23-L35 which can be easily commented out.
but can you check if the 1. No module named ipykernel_launcher is a problem on "vscode debugger" side or "vscode test" side? since "test" button can work while "debug test" button can't, and at the same time they seems used the same arguments, it is odd. maybe there is some mis-configuration for the "debug test" button.
rchiodo commentedon Mar 10, 2026
No module named 'ipykernel_launcher' would be an internal problem with your setup. Debugpy doesn't load that file, your code must be attempting to (given you're debugging ipykernel).
NewUserHa commentedon Mar 11, 2026
but the "test" button in vs code test pannel, which use the pytest framework as well, and it works fine. however the "debug test" button, the difference is which only added a layer debugpy but stopped working and reporting the
No module named 'ipykernel_launcher'.both the buttons self-report is runing the same args by themselvies. so they should both be able to find the entry point and run successfully, by theory.