4

I'm using Visual Studio Code on Windows 10, I installed the Python extension to allow completion, debugging,... I had previously installed python 2.7.

When I try to debug a very easy script (2 print, 1 if, 1 variable assignation) after putting breakpoints, it doesn't stop, the script is executed like there was no breakpoint.

I let the default pythonPath in launch.json and settings.json, and it uses the one in PATH which is the one I want to use, so no problem. I do not use any virtualenv.

Do you have any clue? Thanks

EDIT : Here the code (> marks the lines with breakpoints)

>import sys
>if 1 == 1:
   >print "test"
>test= 'yes'
print "yesyes"
7
  • How about showing us your code and indicating where your breakpoints are
    – MooingRawr
    Commented Sep 30, 2016 at 13:16
  • yeah ok done, hope this helps...
    – Rapha
    Commented Sep 30, 2016 at 13:27
  • Hi Rapha, I'm the author of this extension. Please could you create an issue on github so I could help you with this. FYI - I am unable to replicate this at my end. github.com/DonJayamanne/pythonVSCode/issues
    – Don
    Commented Oct 1, 2016 at 11:33
  • github.com/DonJayamanne/pythonVSCode/issues/348 I will update this thread
    – Rapha
    Commented Oct 1, 2016 at 18:41
  • 1
    Yep, I put the file in the Scripts directory inside the Python27 folder, all files must be placed in a non related python directory!
    – Rapha
    Commented Aug 7, 2017 at 17:55

1 Answer 1

2

In case it is relevant for anyone: in my case breakpoints were not hit due to a remnant piece of code I used for remote debugging using ptvsd:

ptvsd.enable_attach()

Removing this solved this issue while debugging using launch.json for me.

Note: in the OP's case the problem was that they put their code in the C:\Python27\Scripts folder, which should not be done.

Not the answer you're looking for? Browse other questions tagged or ask your own question.