Issue
I'm trying to set up the pdb debugger with IPython in VS Code. I know VS Code has its own debugging system, but I like the pdb / IPython system. It sort of works, but when I try to instantiate a new variable.
I'm opening the anaconda terminal first, and then opening vs code to ensure my conda environment is being used. When I print the os.environ['PYTHONPATH'] variable, it contains both the /anaconda3/envs/myenv folder, as well as the folder containing the currently running *.py file.
I am running the following simple python script:
a = 3
breakpoint()
b = 5
And then when pdb successfully starts up at line 2, if I try to assign "b = 3", then I get an error, "The specified object "= 3" is not a function or was not found along sys.path."
I'm a bit perplexed by this, because I did google / try to modify my PYTHONPATH to include all of the relevant modules. I was wondering if there's something else I have to do...?
Any thoughts appreciated.
Thanks.
Solution
The reason is that "b" is the abbreviation of "break" (set breakpoint) in the "pdb" debugging command, so please use other variable names:
In addition, the debugging function provided by the "Python" extension is very convenient and worthy of being used. It is recommended that you try to use this function in VS Code.
Reference: pdb — The Python Debugger.
Answered By - Jill Cheng
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.