Importing Gtk gives "TypeError: metaclass conflict"
Since Gtk+-3.24.0, I can't import Gtk in Python anymore:
>>> from gi.repository import Gtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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 668, in _load_unlocked
File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
File "/usr/lib/python3.7/site-packages/gi/importer.py", line 146, in load_module
dynamic_module = load_overrides(introspection_module)
File "/usr/lib/python3.7/site-packages/gi/overrides/__init__.py", line 125, in load_overrides
override_mod = importlib.import_module(override_package_name)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/lib/python3.7/site-packages/gi/overrides/Gtk.py", line 136, in <module>
class Widget(Gtk.Widget):
File "/usr/lib/python3.7/site-packages/gi/module.py", line 215, in __getattr__
wrapper = metaclass(name, bases, dict_)
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
There are many equivalent reports after Gtk+-3.22.30+ upgrades (there, there or there for example), but I've found no other solution than downgrading to 3.22.30.
Edited by Guillaume Ayoub