小编Sen*_*Sen的帖子

无法在 Mac High Sierra 上通过 gi.repository 在 python 中导入 WebKit

在过去的几天里,我一直在尝试准备一个可以在 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”等......

我还从webkit.org …

python macos webkit pygobject python-3.x

5
推荐指数
1
解决办法
1777
查看次数

标签 统计

macos ×1

pygobject ×1

python ×1

python-3.x ×1

webkit ×1