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"
-
How about showing us your code and indicating where your breakpoints areMooingRawr– MooingRawr2016年09月30日 13:16:46 +00:00Commented Sep 30, 2016 at 13:16
-
yeah ok done, hope this helps...Rapha– Rapha2016年09月30日 13:27:43 +00:00Commented 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/issuesDon– Don2016年10月01日 11:33:19 +00:00Commented Oct 1, 2016 at 11:33
-
github.com/DonJayamanne/pythonVSCode/issues/348 I will update this threadRapha– Rapha2016年10月01日 18:41:53 +00:00Commented Oct 1, 2016 at 18:41
-
1Yep, I put the file in the Scripts directory inside the Python27 folder, all files must be placed in a non related python directory!Rapha– Rapha2017年08月07日 17:55:16 +00:00Commented Aug 7, 2017 at 17:55
1 Answer 1
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.
Comments
Explore related questions
See similar questions with these tags.