-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Test: Run By Line in Jupyter notebooks #129467
Comments
@roblourens I do not see Run by Line button in the cell toolbar. I installed ipykernel as you mentioned in the instruction. Is there a way to check if I have done correctly? This is what I see |
Ok, I was able to upgrade via |
Another question - I needed to update my ipykernel version (as Miguel mentioned), but now that I've done that, should run by line work in a WSL environment? Before I jump to spinning up a Linux VM, wanted to understand if this was a limitation of WSL, an issue with the actual notebook/run by line, or something else (I usually test Windows or anyOS items so wasn't sure if it was expected WSL may not work). |
Sorry for not being more clear about ipykernel. And I don't know why it wouldn't work in WSL. Did the notebook find your kernel, and were you able to select the right one? |
And you can execute cells with it, and that's the one that you ran when installing ipykernel? |
Yes it's letting me run cells:
I was checking I'm also unsure what I should be seeing in the status bar. I'm used to seeing the Python version of the interpreter, but now it's gone: I tried creating a virtual environment. Initially, it defaulted to Python 3.6.9, so I manually changed it to 3.9.6, and now the status bar reads "Python 3.9.6": However, when I close the virtual env file, the status bar entry disappears: Apologies if these are obvious setup questions - I haven't experienced these issues when running regular Python projects in WSL before, and for more complex setups, I usually use dev containers. But when I tried the notebook in a dev container in WSL, I also still didn't see the run by line. |
I use a virtual env and I recommend that, but it looks like the venv isn't active in your terminal and isn't selected in the notebook. I had better instructions on setting up a venv for debugging in last month's test plan item, I should have posted these again |
Thanks for the links. I created an Azure VM and was just about to give up on WSL and use a VM with a venv for now until I realized the setting was grayed out: I needed to enabled it explicitly for the WSL or SSH remote (rather than just putting it in my local settings.json). Once I did that in WSL, I see run by line: (surprised it took me this long to realize this mistake 😅) Now on to actual testing! |
Oh, that setting should not be machine scoped, I don't know why it is. I'll file an issue. Sorry for the trouble! |
@roblourens Please let me know if I am doing some thing wrong. I have install ipykernel version 6.0.3 and enabled the setting I am blocked on this to test. |
@roblourens just a meta-comment: preparing a Dockerfile for these complex setups is helpful. For my simple-jupyter-notebook I did just that: https://github.com/microsoft/vscode-simple-jupyter-notebook#running-sample-in-docker-container |
Refs: #126431, #128582
Complexity: 3
Authors: @roblourens, @DavidKutu
Create Issue
Make sure you have the latest version of the Jupyter extension installed in VS Code Insiders
Set the experiment setting to enable Run by Line
"jupyter.experimental.debugging": true
Open a .ipynb notebook file
Pick a kernel, make sure you pick the one where you installed ipykernel 6
Click the Run by Line button in the cell toolbar
The button takes a bit to appear, as it's checking that you have ipykernel 6
More testing
Known issues
The text was updated successfully, but these errors were encountered: