Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Step debugging imported modules in Python with Visual Studio Code

import pandas as pd
data = pd.read_csv(some_data)

I put a breakpoint in the second line of this code and Visual Studio Code stops at this breakpoint. But when I try to step into the "read_csv" function vscode apparently performs a "step over". I also tried setting a breakpoint inside the "read_csv" function but with the same result.

So how do I step into the mentioned function?

like image 369
schnesim Avatar asked Dec 27 '18 10:12

schnesim


People also ask

How do I debug a Python module in VS Code?

You can also start the debugger by clicking on the down-arrow next to the run button on the editor, and selecting Debug Python File in Terminal. The debugger will stop at the first line of the file breakpoint. The current line is indicated with a yellow arrow in the left margin.

How do you debug step by step in visual code?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.

How do you debug in Python step by step?

Starting Python Debugger To start debugging within the program just insert import pdb, pdb. set_trace() commands. Run your script normally, and execution will stop where we have introduced a breakpoint. So basically we are hard coding a breakpoint on a line below where we call set_trace().


1 Answers

As of the April 2019 update debugStdLib changed to

"justMyCode": false

https://code.visualstudio.com/docs/python/debugging#_justmycode

like image 125
brickfungus Avatar answered Oct 26 '22 14:10

brickfungus