Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,782 0 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

@heejaechang 已经在做这个了。

开始于 2024年12月15日。

评估

这个 Issue 还没有评估数据。

描述

bug needs repro

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
主要语言
Python
星标
2.5k
派生
205
平均合并
1 天 43 分钟
30 天内合并 PR
6

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/debugpy 的其他 Issue

查看 microsoft/debugpy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。