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

Just my code not working in VS code #1674

Open
irm-codebase opened this issue Aug 1, 2024 · 9 comments
Open

Just my code not working in VS code #1674

irm-codebase opened this issue Aug 1, 2024 · 9 comments
Assignees
Labels
needs repro Issue has not been reproduced yet waiting for response

Comments

@irm-codebase
Copy link

Redirected from #224487

Type: Bug

As the title says: when I set a launch.json file and try to debug my code (selecting "with launch.json", VScode returns:

[Errno 2] No such file or directory: 'home/[myusername]/.local/lib

This is making debugging code outside mine (justMyCode=false) impossible, and is very annoying. What's going on?

Note: I use conda, and I have correctly selected my interpreter to be conda.

VS Code version: Code 1.91.1 (f1e16e1e6214d7c44d078b1f0607b2388f29d729, 2024-07-09T22:08:12.169Z)
OS version: Linux x64 6.9.11-200.fc40.x86_64
Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13700H (20 x 400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 1, 1, 1
Memory (System) 15.25GB (8.81GB free)
Process Argv
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland
Extensions (32)
Extension Author (truncated) Version
markdown-mermaid bie 1.23.1
catppuccin-vsc Cat 3.15.0
catppuccin-vsc-icons Cat 1.13.0
ruff cha 2024.36.0
file-tree-to-text-generator d-k 1.4.0
vscode-markdownlint Dav 0.55.0
EditorConfig Edi 0.16.4
remotehub Git 0.62.0
vscode-drawio hed 1.6.6
compareit in4 0.0.2
mypy mat 0.3.1
rainbow-csv mec 3.12.0
git-graph mhu 1.30.0
debugpy ms- 2024.8.0
python ms- 2024.13.2024073102
vscode-pylance ms- 2024.7.1
jupyter ms- 2024.6.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.19
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-ssh ms- 0.112.0
remote-ssh-edit ms- 0.86.0
azure-repos ms- 0.38.0
remote-explorer ms- 0.4.3
remote-repositories ms- 0.40.0
autodocstring njp 0.6.1
vscode-yaml red 1.15.0
snakemake-lang sna 0.1.8
code-spell-checker str 3.0.1
code-spell-checker-british-english str 1.4.10
even-better-toml tam 0.19.2
@irm-codebase
Copy link
Author

setting "debugpy.debugJustMyCode": false is the cause of the issue. Basically:

  • debugJustMyCode: true ---> the debugger works fine (breakpoints are reached, etc)
  • debugJustMyCode: false ---> the debugger stops working at all, reaching the Errno 2 state.

@irm-codebase
Copy link
Author

Configuration used:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false
        }
    ]
}

Error message seen:
image

@paulacamargo25
Copy link

Thanks for your bug report @irm-codebase, that was a bug in vscode related to justMyCode, can you try again and see if the error persist with the last version of vscode? Thanks

@irm-codebase
Copy link
Author

irm-codebase commented Aug 8, 2024

@paulacamargo25 thanks for the help!

Tried with the config below. Errno 2 no longer happens... but justMyCode is ignored despite setting it to false in both launch.json and settings.json. I could not reach a random breakpoint I placed in the geopandas library.

VSCode is telling me that those settings are not being checked:

image

Is this another, separate issue?

launch.json config:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false
        }
    ]
}

settings.json:

{
    "debugpy.debugJustMyCode": false
}

@irm-codebase
Copy link
Author

irm-codebase commented Aug 8, 2024

Also, small little rant: VSCode has been... pretty bad to work with lately.
Lots of little bugs like this everywhere, constant breaks and instability.

Obviously not the fault of the folks helping with this issue, but it's just... kind of a bad IDE to work with at the moment. At least for python...

Copy link

Hey @karthiknadig, this issue might need further attention.

@irm-codebase, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@irm-codebase
Copy link
Author

@karthiknadig since the bot asked... this bug is till present in the newest VSCode version.
Setting justMyCode to false results in errno2

@karthiknadig
Copy link
Member

The justMyCode issue here seems like something internal to debugpy. Move to debugpy for more investigation.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python-debugger Sep 18, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 18, 2024
@karthiknadig karthiknadig removed their assignment Sep 18, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 18, 2024

This works for me. I used this code here:

import pytest

def test_justmycode():
    pytest.skip("test_justmycode is not implemented yet.")

test_justmycode()

Then I stuck a breakpoint in this file:

.venv\Lib\site-packages_pytest\outcomes.py

The breakpoint hit when running with justMyCode=false.

Can you try that same repro? It might be a path mapping problem. The file you have with the 3rd party code is not the path that debugger is finding.

@rchiodo rchiodo changed the title {$file} ignored when launging python debugger for current file Just my code not working in VS code Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet waiting for response
Projects
None yet
Development

No branches or pull requests

4 participants