microsoft / vscode-python-debugger

Python debugger (debugpy) extension for VS Code.
https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy
MIT License
41 stars 17 forks source link

Constant looping of selecting Python interpreter and launch.json #216

Closed millfields99 closed 4 months ago

millfields99 commented 4 months ago

Debugger goes through a loop of:

  1. After hitting debug (F5 or debug icon) asks to change python interpreter - even though a valid python interpreter already selected
  2. I select exiting or new python interpreter
  3. Get a window saying debug stopped and need to open launch.json
  4. Pre existing setup for python seems ok and no other option avaialble
  5. Retry debug F5 repeats process

Same issues with selecting pre-release version of extension

Python version 3.11.5, Mac OS Sonoma, miniconda env

ssslakter commented 4 months ago

I have the same issue on windows in pip venv. Only reverting to the old 2023.22.1 version of python extension and using its debugger helped =(

kartikgupta-db commented 4 months ago

Similar issue. The debug icon on the top right does not work for me. Creating a basic launch config (from the python launch config creation wizard) and running from there gets me this error. No trace or debug logs either.

Reverting to the old version (as @Ssslakter mentioned) helps.

Python 3.10.11 and 3.11.3. Mac OS Sonoma. Venv and miniconda env.

kartikgupta-db commented 4 months ago

@karrtikr @paulacamargo25 I think I have found the issue.

It seems that the extension is unable to see the python extension until we add explicit dependency on the python extension in package.json.

To reproduce.

  1. Add a trace log to src/extension/common/python.ts: activateExtension printing all extension IDs.
  2. Install the debugger extension (from vsix) and the python extension.
  3. Try running from launch json. The trace does not contain ms-python.python.

With explicit dependency on ms-python.python extension, this is fixed.

Also, this fixes https://github.com/microsoft/vscode-python-debugger/issues/211 as well.

kartikgupta-db commented 4 months ago

@binderjoe this issue is also a blocker for users of the Databricks Extension, since this means users are unable to debug their code completely. Would be great to get a resolution here as well.

cc @fjakobs @saadansari-db @ilia-db

paulacamargo25 commented 4 months ago

Thanks for your investigation @kartikgupta-db , I have been trying to reproduce the error but I can't, would you have an example with which I can reproduce it?

So you mention the problem is because the python extension is not activated? or its not installed? It should find the Python extension because it is installed.

Thanks

kartikgupta-db commented 4 months ago

@paulacamargo25 the issue is even there when the python extension is installed. I am a developer for the Databricks Extension, and our extension is able to pickup the python interpreter, but the python debugger extension errors, and does not see the python extension.

I was able to only repro this when I installed from vsix and not run with nodejs debugger attached.

I need to setup the project again to grab a video of this. I will send that over if that helps.

alexey2baranov commented 4 months ago

I wonder why so few people like this issue? As I can see on the extension page, it has been downloaded 17 million times. Also why it have been fixed so slow.

paulacamargo25 commented 4 months ago

@alexey2baranov thank for your comment, as you can see, it is an error that is only affecting a few users, and also not being able to reproduce it on my computer makes it slower to find a solution. There seems to be a problem in some specific cases that the Python extension cannot be located/activated. This is why as a solution we will update the way in how the information is obtained from the Python Extension.

You have to understand that we follow a process to prioritize issues and solve errors. When this solution is in insiders I will comment on this issue so that you can test it.

Thank you

paulacamargo25 commented 4 months ago

@millfields99 @kartikgupta-db @alexey2baranov Could you try again with the last pre-release version of the Python Debugger Extension 2024.3.10661804 and verify that the error no longer occurs? thanks

deepak1556 commented 3 months ago

@paulacamargo25 bugs don't need verification-needed label, they are only used for feature requests that don't get a TPI.