-
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
Breakpoint ignored when debugging a cell #8803
Comments
Seems to be caused by Python 3.10 changes. Works with latest IPython/IPykernel if using Python 3.9. |
Note run by line seems to work fine. It's only Debug Cell that fails (with IPython 8) |
For me, I had to start debugging twice. Second run and the breakpoints fail to work (ZMQ throws error) |
I just tried ipykernel's main branch and it works fine. |
when switching to Python 3.9.10 breakpoints work ( the rest of env is the same) |
this might be related https://youtrack.jetbrains.com/issue/PY-47999 |
With the new |
Experiencing this as well python 3.9.5 |
Experiencing this as well, both in VSCode and also in Jupyter's web UI when attempting to debug .ipynb files. python 3.10.2 I've seen the exact error as reported by the OP, but I've also encountered the following error:
|
When creating new environment using code below, debugging works with
Content of the makefile: .ONESHELL:
.PHONY: install
PROJECT=debug
VERSION?=3.10.2
VENV=${PROJECT}-${VERSION}
VENV_DIR=$(shell pyenv root)/versions/${VENV}
PYTHON=${VENV_DIR}/bin/python
install:
@echo "Installing $(VENV)"
pyenv virtualenv ${VERSION} ${VENV}
pyenv local ${VENV}
$(PYTHON) -m pip cache purge
$(PYTHON) -m pip install -U pip
$(PYTHON) -m pip install wheel
$(PYTHON) -m pip install ipykernel
$(PYTHON) -m ipykernel install --user --name ${VENV} |
I think this is debugpy/pydevd's fault. At least it is sent the breakpoints but it doesn't fire them. |
Logging an issue on debugpy: |
Hi all, this was a change of behavior in Python 3.10 itself (see: https://mail.python.org/archives/list/python-dev@python.org/thread/VXW3TVHVYOMXDQIQBJNZ4BTLXFT4EPQZ/). I provided a pull request to IPython: ipython/ipython#13535 (still pending). If anyone wants to try it and is comfortable patching the installed version, you can run in the notebook:
And then open the file printed and apply the patch from ipython/ipython#13535 (don't forget to restart the notebook afterwards). p.s.: Given that this issue is an interaction between Python 3.10/ipython/debugpy, I think we can close the issue on vscode-jupyter... |
Thanks @fabioz |
Closing per @fabioz's suggestion. |
As a note, it seems there's another use-case where this happens (with hypothesis: microsoft/debugpy#837), so, I'll provide a bugfix in debugpy itself which will fix both. |
Anything to verify here? |
I think we have to wait for the fix in ipykernel, so probably no? |
I ended up doing a fix in the debugger itself too (see comments in the PR: microsoft/debugpy#851). So, this does need a new debugger release... |
Can't help but observe a seeming hair trigger for closing issues. |
Testing #141223, followed the steps in microsoft/vscode#131469 to set up Jupyter debugging
Environment: macOS 11.6.2, Python 3.10.1, ipykernel==6.7.0
Jupyter extension version 2022.1.1001744497, VS Code 1.64.0-insider commit f93c696
Tried setting a breakpoint in a cell, and the cell would just get executed normally, the breakpoint was ignored.
The cell:
Content of the
Jupyter
output channel after I click on theDebug Cell
button:The text was updated successfully, but these errors were encountered: