Closed kjohnsen closed 3 weeks ago
i had a same issue when import some packages. my case was duplication of package(local and global with python environment variables). so my vscode could not find the appropriate packages in my workspace. please check the package duplication with your code. maybe the main process is using other located same named packages.
good luck!
What do you mean package duplication? I mean, the import would have the choice between the poetry install and the local folder when I call import cleo
, but that's a typical workflow
Thanks for you bug report, but the issue seems to be an error in your code and not in the extension itself. What may be happening is that somehow one of your python files is overwriting one of the ones used for the debugger. You can create an issue in debugpy, maybe they can help you.
Type: Bug
Behaviour
The debugger doesn't stop on breakpoints or errors, but only when importing my package. I can't figure out what it is in my setup that's breaking it. I tried creating a minimal example with a poetry project, but it doesn't reproduce the error, so here are the steps to reproduce with my codebase. The Python and Python Debugger output tabs don't appear to give any hints.
Things I tried that didn't reproduce the error (the debugger did work as expected):
So it's something about a poetry install and something out of the ordinary in my code that (partially) breaks the debugger
Steps to reproduce:
gh repo clone siplab-gt/cleo@wslfp && cd cleo
poetry install && poetry env info
, select VS Code interpreter to be the one in the virtualenv automatically created by Poetryprint('code executed')
in it, stick a breakpoint on it, click 'debug Python file' button, and verify breakpoint worksimport cleo
(my package) at the top and debug file again. Verify that the code still executes (prints to console) but no breakpoint is triggeredDiagnostic data
launch.json
configuration``` XXX ```
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` 2024-03-18 19:15:59.745 [info] Send text to terminal: 2024-03-18 19:15:59.745 [info] Send text to terminal: cd /home/kyle/scratch/cleo-test ; /home/kyle/miniforge3/envs/test/bin/python /home/kyle/.vscode-server-insiders/extensions/ms-python.debugpy-2024.3.10731008-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 47137 -- /home/kyle/scratch/cleo-test/foo.py ```
Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)``` 2024-03-18 19:15:59.531 [info] DAP Server launched with command: /home/kyle/miniforge3/envs/test/bin/python /home/kyle/.vscode-server-insiders/extensions/ms-python.debugpy-2024.3.10731008-linux-x64/bundled/libs/debugpy/adapter ```
Extension version: 2024.3.10731008 VS Code version: Code - Insiders 1.88.0-insider (b356b209a5a41743b45f25d569a7afb733d347a9, 2024-03-18T16:36:07.814Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled