-
Notifications
You must be signed in to change notification settings - Fork 300
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
DS: Fix general debugging bugs for Python Interactive Window and Cells #1283
Comments
How is the progress now ? |
any updates? |
Sorry this is still in progress. We're currently working on modifying the debugger to support this scenario without impacting the rest of the interactive execution. Fundamentally it's different than normal debugging. Normally you start a python process in order to debug it. In our case, the python process is already running and we need to attach, but then detach and continue to run. The detach has some performance implications that we're working through. We don't want to mess up the perf of all of the cells that run after you debug a cell. |
Perhaps, you can release an alpha or beta version for tests on vscode insider or exploration if possible. I cannot wait |
Would you accept user contributions towards this feature? There doesn't seem to be a (public) PR for it and microsoft/vscode-python#3671 is the only issue I can find with details on how to implement this. |
@janosh we're actually mostly complete on this issue. Here are some other issues related to debugging: microsoft/vscode-python#6378 They're all in the 'sign off' phase. For us that means they're complete and just waiting to be shipped. They will be shipping at the end of july. |
Oh nice, very glad to hear that! I didn't realize implementing cell debugging had been split into many manageable chunks of work. (Makes sense though.) 😄 |
This is all available in the insider's build right now if you want to try it out. @ronglums also has a video she posted to twitter: |
@rchiodo I am using the insider's build and noticed the debug cell code lens action. I tried it a few times with different debug configurations (current file, attach & module) but all that ever happened was the cell being executed (although slower than usual), no matter if and how many break points I set. So I assumed this simply wasn't implemented yet but I guess instead I must be doing something wrong. Any docs for this yet? |
What’s your version number for the insider’s build? It doesn’t currently auto-update, but rather stays at the one you installed.
The latest version is 2019.7.25177-dev
|
Thanks for the hint! I updated the insider's build and tried "Debug cell" again. It prompted me that my version of And now it works! Damn, this is cool! |
Thank y'all!!! This feature makes VSCode greater!!( not great again. It is very great so far) |
@janosh Thanks for the report there. There is an issue with the install prompt currently, particularly with the update scenario. I've filed microsoft/vscode-python#6592 to track this and I'm looking at it now. I see the issue, so fix should be incoming soon. |
@IanMatthewHuff I updated to the latest insider today and for some reason cell debugging stopped working. I now get the a message
even though I have |
@janosh what happens if you run |
@rchiodo I get
|
Okay so ptvsd isn't installed then, but for some reason our installation isn't working. We run this to install it:
Wait does just plain 'import ptvsd' work? |
The problem seems to be that the interactive window doesn't pick up on my Running /usr/local/miniconda3/envs/thermo/bin
/usr/local/miniconda3/condabin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin while /usr/local/miniconda3/condabin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin |
Can you go to 'Help | Developer Tools', click on the Console page, right click, save as, and upload the log? Sounds like an activation problem. Also what does
print out in the interactive window? |
And this is what ['/usr/local/miniconda3/envs/thermo/lib/python36.zip',
'/usr/local/miniconda3/envs/thermo/lib/python3.6',
'/usr/local/miniconda3/envs/thermo/lib/python3.6/lib-dynload',
'',
'/usr/local/miniconda3/envs/thermo/lib/python3.6/site-packages',
'/usr/local/miniconda3/envs/thermo/lib/python3.6/site-packages/IPython/extensions',
'/Users/Janosh/.ipython'] |
Ah I bet I know what the problem is. It's running the wrong python. We shouldn't be running
We should do this first in a cell:
Then run something like this as a result of what sys.executable is:
@IanMatthewHuff what do you think? @janosh if you compute the sys.executable path and then run the code I had, does that work? (And by the way thanks a ton for investigating this 👍 ) |
@rchiodo That's correct. Running And running '/usr/local/miniconda3/envs/thermo/bin/python' followed by !/usr/local/miniconda3/envs/thermo/bin/python -c 'import ptvsd;print(ptvsd.__version__)' gives |
Thanks. We likely need to change the pip install command too. Instead of
We should do
|
@rchiodo Happy to help! Thanks to you guys, I finally have a Python IDE that I really enjoy working with. Keep up the great work! |
Yeah, my mistake on what was on the path for the interactive window. I think that I happened to be in a situation where the path worked when I tested this so I didn't notice. I'll look at fixing this up today. |
@janosh I've got microsoft/vscode-python#6638 in progress currently. I expect this to be in today and that is should resolve the issue. Thanks for the report. |
@IanMatthewHuff Fix confirmed. Cell debugging is working again. And for the first time this time, the |
When will the July Update be released? It's August now. |
Also really looking forward to that! :) |
@safekidda. Can you post what you see in the developer console log? Seems like something else might be going on here in your scenario. |
I'd like to know if it's possible, or why it's currently not possible, to run Python: Debug current file in Python Interactive window and have:
Is it in the roadmap to have a better way to view variables, like large arrays, that's fast like in Spyder? With Data Science, I do a lot of that in Matlab and in Python, without using Spyder, which I'd rather not, there isn't a good way to quickly and nicely view data arrays and large datasets. |
It would best if you entered a new suggestion. Essentially you want two new features:
Both of these are possible, but not currently supported. |
Hi guys! Great progress meanwhile. I'd like to ask that if you are debugging a script, stopping at the breakpoint, selecting some code and hitting "Shift+Enter", the interactive window would open in the debugger's context. |
@igrinis Not sure what you mean by
Do you mean you're debugging a normal python script, you select some code while you're debugging, and then hit SHIFT+ENTER, that suddenly the interactive window would open and debug the code you just selected? Wouldn't this create two debug contexts? You can't really start executing other code while you're stopped at a breakpoint. |
I will try to explain better. See example:
All I want that the last two lines would be "magically" executed in the context of the debugger, so I will receive "8" in the process output window, under the '==='. Obviously, the value of I get the desired behavior if I manually copy the code to the Debug console, but it's SO inconvenient. Currently (at least in VSCode-insiders) in this scenario I get REPL window opened and Ideally, I see that Debug console, Python Interactive and REPL windows will get merged in the future, as they mostly repeat the same functionality. |
Ah so it sounds like you want the interactive window to be able to connect to your currently running process. I believe we already have a similar issue: |
You are correct. But until it is implemented I would ask to change the behavior of Shift+Enter to copy code into Debug Console (if during debug session), instead to the unrelated REPL. |
Can you enter a separate issue for that? It will likely get lost just leaving it here. |
After some consideration, I think it would be better to wait for proper implementation. Shift+Enter is already overloaded. It wouldn't be right to add clutter. Thank you for the discussion, anyways. |
FWIW, I've also started experiencing this exact behavior, i.e. the debugger persistently carrying out the session in an |
@janosh would you have happened to opened an notebook editor too? This bug might be the cause: |
By notebook, do you mean an |
An ipynb file. It looks like you have one open in the background? |
In that case, no notebooks involved on my end. That GIF was just quoted from @Coderx7's post above. |
Ah, thanks. Do you happen to have some repro code then? |
Sorry, don't have a way of deliberately causing this at the moment. It seems to happen more often in a kernel that's been running for a while. So maybe it's to do with accumulation of state. I'll keep an eye out for a reliable trigger. |
Closing as this is an umbrella issue that has likely gone stale. Please open a new issue if you encounter new problems with debugging in the interactive window. |
This epic covers any functionality relating to debugging python interactive cells with this extension. This includes breakpoints, stepping, data visualization, etc.
The text was updated successfully, but these errors were encountered: