gpt4 book ai didi

GdkPixBuf 的 Python 导入显示 "introspection typelib not found"

转载 作者:行者123 更新时间:2023-12-01 03:50:15 36 4
gpt4 key购买 nike

我有一些进口:

gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk, GdkPixBuf

出现错误(可能是 2):

WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "camerapython.py", line 10, in <module>
from gi.repository import Gdk, GdkPixBuf
File "/usr/lib/python3/dist-packages/gi/importer.py", line 53, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name GdkPixBuf, introspection typelib not found

我注意到,在 gi 的 importer.py 中,repository.enumerate_versions(namespace) 返回 GdkPixBuf 的 [] (因此引发错误)。

其他导入会返回一些内容:

Gtk : ['3.0']
GObject : ['2.0', '2.0']
GLib : ['2.0', '2.0']
Atk : ['1.0', '1.0']
Gdk : ['3.0', '3.0']
cairo : ['1.0', '1.0']

如果需要,我的版本是 Raspbian (Raspberry Pi 3)。

最佳答案

你导入的 Pixbuf 是错误的,应该是

from gi.repository import Gdk, GdkPixbuf

关于GdkPixBuf 的 Python 导入显示 "introspection typelib not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38363492/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com