Issue 1:
Bug summary

import matplotlib.pyplot as plt

Nomatter what drawing behavior(plot, scatter...) I uesd, I would always get below error:

Traceback (most recent call last):
File "dt.py", line 14, in <module>
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 2817, in scatter
__ret = gca().scatter(
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 2272, in gca
return gcf().gca(**kwargs)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 865, in gcf
return figure()
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 809, in figure
FigureClass=FigureClass, **kwargs)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 324, in new_figure_manager
_warn_if_gui_out_of_main_thread()
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 314, in _warn_if_gui_out_of_main_thread
if (_get_required_interactive_framework(_get_backend_mod())
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 217, in _get_backend_mod
switch_backend(dict.__getitem__(rcParams, "backend"))
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 262, in switch_backend
switch_backend(candidate)
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 282, in switch_backend
class backend_mod(matplotlib.backend_bases._Backend):
File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 283, in backend_mod
locals().update(vars(importlib.import_module(backend_name)))
File "C:\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qtagg.py", line 12, in <module>
from .backend_qt import (
File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qt.py", line 76, in <module>
for mod, key in [
File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qt.py", line 76, in <listcomp>
for mod, key in [
TypeError: int() argument must be a string, a bytes-like object or a number, not 'KeyboardModifier'

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

x = np.array([1, 2, 3, 4, 5, 6, 7, 8])
y = np.array([1, 4, 9, 16, 7, 11, 23, 18])

plt.scatter(x, y)
plt.show()

Actual outcome

Traceback (most recent call last): File "dt.py", line 14, in plt.scatter(x, y, s=area, c=colors, alpha=0.5) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 2817, in scatter __ret = gca().scatter( File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 2272, in gca return gcf().gca(**kwargs) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 865, in gcf return figure() File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 809, in figure FigureClass=FigureClass, **kwargs) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 324, in new_figure_manager _warn_if_gui_out_of_main_thread() File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 314, in _warn_if_gui_out_of_main_thread if (_get_required_interactive_framework(_get_backend_mod()) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 217, in _get_backend_mod switch_backend(dict.getitem(rcParams, "backend")) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 262, in switch_backend switch_backend(candidate) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 282, in switch_backend class backend_mod(matplotlib.backend_bases.Backend): File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 283, in backend_mod locals().update(vars(importlib.import_module(backend_name))) File "C:\Python37\lib\importlib_init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qtagg.py", line 12, in from .backend_qt import ( File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qt.py", line 76, in for mod, key in [ File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qt.py", line 76, in for mod, key in [ TypeError: int() argument must be a string, a bytes-like object or a number, not 'KeyboardModifier'

Expected outcome

Scatter draw

Additional information

No response

Operating system

Windows

Matplotlib Version

3.5.3

Matplotlib Backend

Traceback (most recent call last): File "", line 1, in File "C:\Python37\Lib\site-packages\matplotlib_init_.py", line 1172, in get_backend return rcParams['backend'] File "C:\Python37\Lib\site-packages\matplotlib_init_.py", line 674, in getitem plt.switch_backend(rcsetup._auto_backend_sentinel) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 262, in switch_backend switch_backend(candidate) File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 282, in switch_backend class backend_mod(matplotlib.backend_bases.Backend): File "C:\Python37\Lib\site-packages\matplotlib\pyplot.py", line 283, in backend_mod locals().update(vars(importlib.import_module(backend_name))) File "C:\Python37\lib\importlib_init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qtagg.py", line 12, in from .backend_qt import ( File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qt.py", line 76, in for mod, key in [ File "C:\Python37\Lib\site-packages\matplotlib\backends\backend_qt.py", line 76, in for mod, key in [ TypeError: int() argument must be a string, a bytes-like object or a number, not 'KeyboardModifier'

Python version

3.7.0

Jupyter version

No response

Installation

pip

Issue 2:
Bug summary

matplotlib/lib/matplotlib/backends/qt_compat.py

Line 144
in
318b234

_to_int = operator.attrgetter("value") if QT_API == "PyQt6" else int

Have to check for "PySide6" too.

Code for reproduction

$ QT_API=pyside6 python -c "import matplotlib.backends.backend_qt5agg"

Actual outcome

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/tmp.atoQSuHf68/venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5agg.py", line 7, in <module>
from .backend_qtagg import ( # noqa: F401, E402 # pylint: disable=W0611
File "/tmp/tmp.atoQSuHf68/venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtagg.py", line 12, in <module>
from .backend_qt import QtCore, QtGui, _BackendQT, FigureCanvasQT
File "/tmp/tmp.atoQSuHf68/venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt.py", line 72, in <module>
_MODIFIER_KEYS = [
File "/tmp/tmp.atoQSuHf68/venv/lib/python3.10/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

no errors

Additional information

PySide6==6.4.0

Operating system

GNU\Gentoo Linux

Matplotlib Version

3.6.1

Matplotlib Backend

same exception

Python version

3.10.6

Jupyter version

not installed

Installation

pip