Skip to content
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

Checks wether matplotlib's backend is interactive even though matplotlib is not required and not installed #1782

Open
keuj6 opened this issue Dec 14, 2024 · 0 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@keuj6
Copy link

keuj6 commented Dec 14, 2024

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: path

During 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:

  1. Initialize a new project with uv and add colour-science package
uv init
uv add colour-science
  1. Add import colour in default hello.py
import colour


def main():
    print("Hello from reproduce-debugpy-error!")


if __name__ == "__main__":
    main()
  1. Add a breakpoint anywhere and run Python Debugger: Debug Python File
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python-debugger Dec 15, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants