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

Debug console on interactive Python script not able to create new variables #1815

Open
rvillar-villari opened this issue Jan 22, 2025 · 4 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@rvillar-villari
Copy link

Hi,

I am experiencing many issues with the Python debugger in VS Code, but this one seems especially silly. I am currently debugging a Python script that I have separated into cells, so I have my script with the debugger active on it, the interactive window and then another panel with my variables, terminal and debug console.

Right now, the debug console is unable to create new variables. I wanted to copy a variable to test something on it, but it cannot find the newly created variable (see screenshot below). Any idea why this is? As I said, I have been having many issues so potentially this could have something to do with something more complex going on? Would be happy to elaborate if needed.

Image

@rvillar-villari
Copy link
Author

Also I just had the issue that when I tried to debug the cell, VS Code opened a sort of temporary file where only the code of the cell being debugged is shown, looks like plain text, and I cannot interact with the code.

Image

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python-debugger Jan 24, 2025
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 24, 2025
@karthiknadig
Copy link
Member

Moving this to debugpy since the execution is handled there.

@rchiodo I think this might be due to running this in eval mode, but there should be a fallback that runs in exec mode if eval fails. It may have been removed to prevent side effects.

@karthiknadig
Copy link
Member

This seems to work for me for scripts:

Image

@rvillar-villari is this notebook debugging?

@rchiodo
Copy link
Contributor

rchiodo commented Jan 24, 2025

This sort of thing has happened before but we were never able to get a consistent repro. Can you turn on logging as described here and upload the logs?

https://github.com/microsoft/debugpy/wiki/Enable-debugger-logs

Additionally can you try this with 3.11 and see if it reproduces there?

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
Projects
None yet
Development

No branches or pull requests

4 participants