matplotlib / matplotlib/ipympl

%matplotlib widget run time error

オープン
#559 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
1.7k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,
I saw an old issue about this topic, but I could not find a recent solution.
I am using a Linux machine, Python version 3.12.4. I created my environment and I installed matplotlib by using
pip install matplotlib

But when I run my code in VS code, I get a runtime error related to %matplotlib widget

RuntimeError Traceback (most recent call last)
File ~/.conda/envs/s_i/lib/python3.12/site-packages/matplotlib/backends/registry.py:413, in BackendRegistry.resolve_gui_or_backend(self, gui_or_backend)
412 try:
--> 413 return self.resolve_backend(gui_or_backend)
414 except Exception: # KeyError ?

File ~/.conda/envs/s_i/lib/python3.12/site-packages/matplotlib/backends/registry.py:375, in BackendRegistry.resolve_backend(self, backend)
374 if gui is None:
--> 375 raise RuntimeError(f"'{backend}' is not a recognised backend name")
377 return backend, gui if gui != "headless" else None

RuntimeError: 'widget' is not a recognised backend name

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
Cell In[3], line 8
3 from pathlib import Path
5 #import ephyviewer
6 #import spikeinterface_gui as sigui
----> 8 get_ipython().run_line_magic('matplotlib', 'widget')
9 get_ipython().run_line_magic('matplotlib', 'inline')
10 #%matplotlib notebook
...
414 except Exception: # KeyError ?
--> 415 raise RuntimeError(
416 f"'{gui_or_backend} is not a recognised GUI loop or backend name")

RuntimeError: 'widget is not a recognised GUI loop or backend name

Have you found a solution for this issue?
thank you

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、報告された Linux、Python 3.12.4、VS Code 環境で %matplotlib widget を再現し、次に matplotlib/backends/registry.py に示されている backend 解決パスを調べます。ipympl と Jupyter の統合設定と動作を比較します。この構成で原因と再現可能な解決策が特定できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
jupyter-notebook, matplotlib, python, vscode
領域
frontend, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。