2

我正在尝试运行beeware教程。

添加toga.WebView时,我在运行时收到以下错误消息briefcase run -u

** (__main__.py:25869): WARNING **: 16:57:29.287: Failed to load shared library 'libwebkit2gtk-4.0.so.37' referenced by the typelib: /lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37: undefined symbol: cairo_font_options_set_variations
/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/widgets/webview.py:21: Warning: cannot retrieve class for invalid (unclassed) type 'void'
  self.webview = WebKit2.WebView()
Traceback (most recent call last):
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/app.py", line 93, in gtk_startup
    self.interface.startup()
  File "/tmp/.mount_fubar0Ml5JP/usr/app/fubarr/app.py", line 32, in startup
    song=toga.WebView(url="https://stackoverflow.com")
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga/widgets/webview.py", line 28, in __init__
    self._impl = self.factory.WebView(interface=self)
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/widgets/base.py", line 11, in __init__
    self.create()
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/widgets/webview.py", line 21, in create
    self.webview = WebKit2.WebView()
TypeError: could not get a reference to type class

到目前为止我尝试了什么:

  • 将 pycairo 降级到 1.11.1
  • 只需import toga; toga.WebView(url="https://stackoverflow.com")在 virtualenv 中运行 ..即可
  • 网络搜索
  • 向意大利面怪物祈祷

我正在使用 ubuntu 19.10 和 python 3.7.5。

感谢您的任何提示。

4

0 回答 0