Christine
Christine

Reputation: 111

vscode debugger does not launch debug console

I am so frustrated that my vscode debugger does not work on the remote servers suddenly today. Here is the situation. enter image description here

When I use the starred interpreter by vscode (the recommended one), it works smoothly. However, when I want to use other interpreters, the ones stored in personal folder on the server, the debugger doesn't launch a debug console and dose not enter the file.

Vscode can find and recognize the interpreters and I can use those interpreters to run scripts but can NOT DEBUG.(on the remote server) However, it works fine on my local machine with multiple python interpreter.

Can anyone give me some help? I have tried uninstall vscode completely on my end but still not work. Thank you so much!!

Upvotes: 7

Views: 8853

Answers (3)

Peter
Peter

Reputation: 12375

The Python extension debugger in VSCode requires a minimum Python version to run properly. However, this is not documented at all in the changelog at https://github.com/microsoft/vscode-python/releases, but you have to find out for yourself. For example, at the time of writing, version 2022.12.0 doesn't harmonize with Python 3.6.8.

As a workaround you have 2 options

  1. Upgrade your interpreter to a newer version

  2. Downgrade the Python extension to an older version

For the latter, go to the extensions page and under the Uninstall button you will find Install another version.... This makes it easy to try out what works best for you.

enter image description here

Upvotes: 7

edferda
edferda

Reputation: 450

Just in case stumbles upon this question and the accepted answer doesn't work for you:

Try downgrading the Python extension version in VSCode. That fixed the issue for me. I picked a random version from ~2 months ago (when I wasn't having the issue). You might need to try a few versions though.

Upvotes: 4

lalaland
lalaland

Reputation: 54

This workaround might work for you: use the interpreter that works for you but in the launch.json configuration file add a "python": "/path/to/the/python/you/want",

I share the same experience. It seems that vscode fails to start the remote debugger with the interpreter I want but succeeds with the system interpreter. For example:

"configurations": [  
         {  
            "name": "config_name",   
            "type": "python",  
            "python": "/path/to/desired/python",  
            "request": "launch",  
            "program": "/path/to/python/script.py",  
            "console": "integratedTerminal",  
        },  
]

Upvotes: 2

Related Questions