1

I am trying to remote debug from Visual Studio Code on Mac OS. I would like to know if anyone has managed this or if it only possible from Visual Studio for Windows, or if not, what am I doing wrong?

When I click on the green arrow to launch the debugger on my local file, nothing happens. Seems debugger starts, I get a blue dash moving laterally below the green start debugger button and that's it. No error message on the client and no connection made on the server side (script not moving beyond a ptvsd.wait_for_attach()).

I have also tried to set the remote host as localhost and do one port forwarding with no effect.

Can anyone help?

I have attached my config file below

"version": "0.2.0",
"configurations": [

    {
        "name": "Attach (Remote Debug)",
        "type": "python",
        "request": "attach",
        "localRoot": "${workspaceRoot}",
        "remoteRoot": "/home/pi/test",
        "port": 5678,
        "secret": "my_secret",
        "host": "192.1.1.11"
    },
and the py script:

import random
import ptvsd
ptvsd.enable_attach('my_secret')
ptvsd.wait_for_attach()

guesses_made = 0
name = input('Hello! What is your name?\n')
number = random.randint(1, 20)
print('Well, {0}, I am thinking of a number between 1 and 20.'.format(name))

while guesses_made < 6:
guess = int(input('Take a guess: '))
guesses_made += 1
if guess < number:
print('Your guess is too low.')
if guess > number:
print('Your guess is too high.')
if guess == number:
break

if guess == number:
print('Good job, {0}! You guessed my number in {1} guesses!'.format(name, guesses_made))
else:
print('Nope. The number I was thinking of was {0}'.format(number))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.