<frame not available> when debugging pydantic
I use the pydantic library. No breakpoints within the pydantic code get hit and when an exception is thrown inside pydantic code, I only see <frame not available>.
I can reproduce it with the following minimal setup:
1. create a venv for a project and install pydantic into it:
python -m venv venv
source venv/bin/activate
pip install pydantic
2. create a super-simple script with a pydantic model:
#simple.py
from pydantic import BaseModel
class MonthYear(BaseModel):
year: int
month: int
MonthYear.parse_obj('test')
Running this raises an Exception inside pydantic code and the execution halts at the exception breakpoint, but I only see this:

The console output also doesn't "realize" that the sources are in fact available (no clickable link for the pydantic/main.py):

However, the sources are available, but also breakpoints inside them are not hit:

The python interpreter is configured correctly and also 'sees' the installed pydantic library:

I am very grateful for any hints on how to fix this issue :)
BR Felix
Please sign in to leave a comment.
I have created an issue for the developer to take a look: https://youtrack.jetbrains.com/issue/PY-41951
I suspect it has to do with how pydantic works. E.g. it's not using pydantic/main.py at all, you can even remove/rename this file and the code still runs.
i found a hint at https://github.com/microsoft/debugpy/issues/430.
I had to remove all .so files (on Linux) from python's site-packages/pydantic