question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python debug adapter not starting

See original GitHub issue

On my work machine I can nicely debug Python. However on my personal machine it is not working (it was previously working and I am not sure what changed in the meantime).

Here’s what I am seeing with a simple print(“hello”) script on my macOS:

  1. I can run the python script using the run button
  2. If I debug the python script it will not get executed and neither the breakpoints will get hit
  3. It seems like starting the debug adapter fails because Karthik looked into the logs and they are completely empty
  4. I can reproduce this with any combination of VS Code Stable, VS Code Insiders, Python Stable, Python Insiders
  5. I can not reproduce if I tell Python to use Interpreter 2.7.16
  6. I can reproduce if I use Python 3.9 64 bit and 3.8.9 64 bit
  7. Debugging from the VS Code side it looks like the init call fails
  8. I installed XCode 12 since this was last working. So this is my main suspect of the breakage.

Let me know what more information you need and I will be happy to provide it. Thanks a lot, really appreciate the help

My launch.json for reference:

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
weinandcommented, Oct 7, 2021

@isidorn I have no ideas…

For me Python debugging just works. My python path is: /Users/weinand/.pyenv/shims/python A week ago I installed XCode 13.0 and that did not change anything in my Python setup.

@deepak1556 for investigating Isidor’s problem, we started VS Code with the --inspect-extensions <port> command line argument, which puts the extension host node.js process in debug mode so that we can attach a debugger. But weirdly enough this prevents the problem from occurring.

Since the extension host runs in the Electron provided node.js, I wonder whether you are aware of any Electron/node.js issues that are related to spawning other programs on macOS (in this case the node.js based debug adapter for Python).

0reactions
isidorncommented, Oct 19, 2021

Yes I did. That’s weird. Though all is working now so for me we do not have to continue the investigation. Deepak if you think there might be something useful hiding here let me know and we can debug it together.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - Debug Adapter Fails to Start When Launching Code ...
Hello,. I am having an issue where when I attempt to launch a Python script from a cloned Solution on a network server,...
Read more >
Python: Failed to Launch Debug Adapter, Operation was ...
1 Answer 1 · Drop down the Python environment selector, · Navigate to existing environment · Select the latest version of python environment...
Read more >
VS Code Debugger not working for python - Microsoft Q&A
Debugging was working fine. Any troubleshooting tips. It seems when I do Run->"start Debugging' no command comes to terminal. Any VS Code log ......
Read more >
Debugging Python In Visual Studio by Lee Fig
I think the problem is with the VS debug adapter. ... Is there a way to launch the python -lean runtime without using...
Read more >
Python debugger not working while normal run does
The python debugger in Pycharm (I've the latest version) is not working for any Python file (so it's not my project or anything)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found