-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: 3.6.0 doesn't interact well with pycharm throwing "backend_interagg" exception #23911
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
Comments
Does this change make it work? ✔ 14:16:01 $ git diff
diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py
index f5c86de126..1e94d90d15 100644
--- a/lib/matplotlib/pyplot.py
+++ b/lib/matplotlib/pyplot.py
@@ -263,7 +263,6 @@ def switch_backend(newbackend):
backend_mod = importlib.import_module(
cbook._backend_module_name(newbackend))
- canvas_class = backend_mod.FigureCanvas
required_framework = _get_required_interactive_framework(backend_mod)
if required_framework is not None:
@@ -293,6 +292,8 @@ def switch_backend(newbackend):
# also update backend_mod accordingly; also, per-backend customization of
# draw_if_interactive is disabled.
if new_figure_manager is None:
+ # only try to get the canvas class if have opted into the new scheme
+ canvas_class = backend_mod.FigureCanvas
def new_figure_manager_given_figure(num, figure):
return canvas_class.new_manager(figure, num)
|
This is to un-break pycharm's backend_interagg Closes matplotlib#23911
I do not think this PR fixes the problem, after applying the changes, now exception is thrown on Line 185
|
One more check needs to be added:
|
I don't believe the latter check was implemented. |
No, it's not. |
Can confirm this is still an issue with matplotlib 3.6.0 on python 3.10 in PyCharm 2022.2.2 |
Not working on PycharmPro
Error
|
This is to un-break pycharm's backend_interagg Closes matplotlib#23911
Problem still occurring in PyCharm for me. Still requires FigureCanvas on backend module, running matplotlib 3.8.1. See line 342 of pyplot.py |
Not having a |
AFAICT, JetBrains added those values over a year ago, but I cannot tell from the tags exactly what version that means. |
Update fixed. Thanks. |
Bug summary
While using Pycharm and matplotlib 3.6.0 as soon as we import matplotlib, the interpreter crash
Code for reproduction
Actual outcome
Expected outcome
same thing works with version 3.5.2
Additional information
No response
Operating system
No response
Matplotlib Version
3.6.0
Matplotlib Backend
module://backend_interagg
Python version
3.8
Jupyter version
No response
Installation
No response
The text was updated successfully, but these errors were encountered: