Checks wether matplotlib's backend is interactive even though matplotlib is not required and not installed
@heejaechang is already working on this.
Since Dec 15, 2024.
Assessment
This issue has not been assessed yet.
Description
Environment data
- "Python Debugger" extension: v2024.14.0 (debugpy-1.8.9)
- OS and version: macOS Sequoia 15.1.1
- Python version: 3.12.7
- VS Code: 1.95.3
- colour-science: 0.4.6
Actual behavior
In VS Code, I work on a Python script importing colour-science without matplotlib installed:
- The script runs without raising errors
- Setting a breakpoint and attempting to debug causes the VS Code Python debugger to crash/stop
Error raised:
Exception has occurred: ModuleNotFoundError
No module named 'matplotlib.rcsetup'; 'matplotlib' is not a package
AttributeError: pathDuring handling of the above exception, another exception occurred:
File "/My/Path/.vscode/extensions/ms-python.debugpy-2024.14.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py", line 59, in is_interactive_backend
from matplotlib.rcsetup import interactive_bk, non_interactive_bk # @UnresolvedImport
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/My/Path/.vscode/extensions/ms-python.debugpy-2024.14.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py", line 99, in activate_matplotlib
is_interactive = is_interactive_backend(backend)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/My/Path/Documents/python_projects/reproduce_debugpy_error/hello.py", line 9, in
main()
^^^^
ModuleNotFoundError: No module named 'matplotlib.rcsetup'; 'matplotlib' is not a package
Expected behavior
The debugger should stop at breakpoint and allow stepping through the code
Steps to reproduce:
- Initialize a new project with uv and add
colour-sciencepackage
uv init
uv add colour-science
- Add
import colourin defaulthello.py
import colour
def main():
print("Hello from reproduce-debugpy-error!")
if __name__ == "__main__":
main()
- Add a breakpoint anywhere and run
Python Debugger: Debug Python File
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 202
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/debugpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in microsoft/debugpy
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·