-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataScience - Using ipdb.set_trace() in python interactive mode #533
Comments
Debugging using the interactive window doesn't require you use ipdb at all. It's built into running and executing cells. Please see the docs here: |
There's also an experimental way to debug inside of a jupyter notebook: |
Hi, I do not succeed to use your built-in debugger within a jupyter notebook (NOT an interactive ipython session ran from a python script). Setting a breakpoint() inside a cell doesn't work. All I wish is to be able to use the python debugger with the magic command %pdb, as it is possible when running a jupyter notebook with jupyter. Currently, adding %pdb on at the beginning of a cell makes it run indefinitely - as if a user input were expected (but it cannot be provided since no input box appears in your interface). |
Sorry %pdb is not supported. The only options at the moment are the Run By line experiment (which only works in the stable version of VS code when not using the new UI) and debugging through the interactive window. Debugging of notebooks in general is on our backlog. For more information, you can track this issue here: |
Thank you for your reply. Nice to see that you are planning to implement it. Related question: in spyder, when %pdb is ON and that an unhandled error is raised, the python console enters in python debug mode and the editor jumps to the file where the error occurs, very conveniently pointing the relevant line with a blue arrow. Is there any similar workflow in VScode? I am thinking about transitioning, and I am 90% convinced but the inability to debug my code makes it a strong no-go at the moment. |
There will be when we implement notebook debugging. Right now regular python debugging (or interactive window debugging) work this way. Unhandled exceptions stop where the exception is thrown. |
Cheers, I am describing my feature request in a more concise way at #1652. |
VScode is getting more popular into DataScience community because of its REPL (interactive python window) while being a better than IDE than Jupyter Notebooks.
Usually people (or atleast me in Pycharm) debug with
import ipdb; ipdb.set_trace()
orimport pdb; pdb.set_trace()
. input/output and then redirected to the console (same behaviour on Rstudio). However in VScode input is redirected to a new small top window which block any action (see screenshot).Debugging in VScode while using interactive python is currently not possible and it is painful. Am I missing something (eventhough i spent time on google before making this issue) or is the feature not supported? What is the best way to debug in Python interactive mode?
The text was updated successfully, but these errors were encountered: