Debug Cells / Run Cells are selecting wrong cell / wrong lines after 2nd Debug Cell. Freezes after 3rd Debug Cell.
See original GitHub issueEnvironment data
- VS Code version: 1.60.0
- Jupyter Extension version (available under the Extensions sidebar): v2021.8.2041215044
- Python Extension version (available under the Extensions sidebar): 3.7/2.7/3.9 (all)
- OS (Windows | Mac | Linux distro) and version: Mac 11 & Ubuntu 20
- Python and/or Anaconda version: 3.7/2.7/3.9 (all)
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv & no environment affected
- Jupyter server running: Issue on Local & Remote
Expected behaviour
This is a 100% clean install. Problem is on Mac OS and Ubuntu.
I have a plain .py file and use “# %%” Cell Marker (jupyter.defaultCellMarker). When I click “Debug Cell”, it debugs the cell properly. When I click on any random cell, it debugs that cell properly line-by-line. When I interrupt the kernel, it stops, but allows me to debug cells.
Actual behaviour
When I click “Debug Cell”, it will only allow me to debug that cell and ONLY that cell. This prevents me from debugging any other cell. If I try to debug another cell, it will still highlight the first cell that was debugged. However, the output will be from the selected cell.
Issue exists on mac and ubuntu with clean installs of VSCode + Extensions.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Create a .py file
- Add the following code to the file:
# %%
print(1)
print(2)
print(3)
# %%
print(4)
print(5)
print(6)
# %%
print(7)
print(8)
print(9)
- In VS Code, select the second cell’s “Debug Cell” command.
- Iterate through print lines 4, 5, 6.
- In VS Code, select the third cell’s “Debug Cell” command.
- It will select cell with print statements for 4, 5, 6, instead of 7, 8, 9. When iterating, the output will be 7, 8, 9. Which doesn’t match the selected cell.
- Select the first cell.
- Extension will freeze. There will be no ability to iterate / debug the cell. Interrupting the kernel does not work. Only kernel restart works.
Any ideas about a workaround or a fix for this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (1 by maintainers)
Top GitHub Comments
Thanks for getting back to us @ThisntWorking.
We meant the ipykernel version. For instance, if you’re using pip run
pip show ipykernel
and that should show the version.This may be related to the version of ipykernel you have installed in your environment. What is it? If it’s version 6, it’s a known issue #7141