在过去的几天里,我一直在尝试准备一个可以在 python 中使用 GTK 和 WebKit 的开发。我已经放弃了ubuntu,现在只想先专注于mac。我已经安装了pygobject3并且可以加载GTK 3.0。但我无法让 WebKit 工作。错误信息是这样的,
>>> import gi
>>> from gi.repository import WebKit
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 888, 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 "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/gi/importer.py", line 127, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name WebKit, introspection typelib not found
Run Code Online (Sandbox Code Playgroud)
我尝试过“WebKit2”、“WebKit3”等......