Skip to content

[Bug]: PySide6 6.4.0 and FigureCanvasQTAgg Combability #24175

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

Closed
MosGeo opened this issue Oct 15, 2022 · 4 comments
Closed

[Bug]: PySide6 6.4.0 and FigureCanvasQTAgg Combability #24175

MosGeo opened this issue Oct 15, 2022 · 4 comments

Comments

@MosGeo
Copy link

MosGeo commented Oct 15, 2022

Bug summary

Using the latest PySide6 version (6.4.0) and Matplotlib version (3.6.1), it is not possible to import FigureCanvasQTAgg. It seems that the whole Qt backend breaks.

Code for reproduction

from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg

Actual outcome

  File "C:\Users\Mustafa\Desktop\Projects\test_project\test.py", line 1, in <module>
    from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
  File "C:\Users\Mustafa\Desktop\Projects\test_project\.venv\lib\site-packages\matplotlib\backends\backend_qtagg.py", line 12, in <module>
    from .backend_qt import QtCore, QtGui, _BackendQT, FigureCanvasQT
  File "C:\Users\Mustafa\Desktop\Projects\test_project\.venv\lib\site-packages\matplotlib\backends\backend_qt.py", line 72, in <module>
    _MODIFIER_KEYS = [
  File "C:\Users\Mustafa\Desktop\Projects\test_project\.venv\lib\site-packages\matplotlib\backends\backend_qt.py", line 73, in <listcomp>
    (_to_int(getattr(_enum("QtCore.Qt.KeyboardModifier"), mod)),
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier'

Expected outcome

Success import and usage

Additional information

No response

Operating system

Windows

Matplotlib Version

3.6.1

Matplotlib Backend

No response

Python version

3.10.8

Jupyter version

No response

Installation

pip

@MosGeo
Copy link
Author

MosGeo commented Oct 15, 2022

Ok. Looks like it is fixed in the latest dev version.

@MosGeo MosGeo closed this as completed Oct 15, 2022
@cyz1cyz
Copy link

cyz1cyz commented Oct 28, 2022

Today(Oct 28) I also find this bug in pyside6 6.4.0.1

@zlmturnout
Copy link

Today(Oct 28) I also find this bug in pyside6 6.4.0.1

same bug with python=3.11 matplotlib=3.6.1 and PySide6=6.4.0.1

@tacaswell
Copy link
Member

The problem is an unexpected change in pyside6 in how they handled their enums. This was fixed in #24158 and well be in mpl 3.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants